Пример #1
0
 private void btnConfigOnly_Click(object sender, EventArgs e)
 {
     foreach (TabPage tpgCAN in tabControl.TabPages)
     {
         foreach (Control control in tpgCAN.Controls)
         {
             UCCANConfig ucCANConfig = control as UCCANConfig;
             if (ucCANConfig != null)
             {
                 ucCANConfig.ConfigOnly();
                 break;
             }
         }
     }
     this.DialogResult = DialogResult.OK;
 }
Пример #2
0
 private void UpdateConfigPanel()
 {
     tabControl.TabPages.Clear();
     if (device != null)
     {
         for (uint channelIndex = 0; channelIndex < device.CANNum; channelIndex++)
         {
             TabPage tpgCAN = new TabPage(string.Concat("CAN", channelIndex));
             tpgCAN.Name = string.Concat("tpgCAN", channelIndex);
             //tpgCAN.AutoScroll = true;
             UCCANConfig ucConfigCAN = new UCCANConfig(device.GetChannel(channelIndex));
             tpgCAN.Controls.Add(ucConfigCAN);
             //ucConfigCAN.Parent = tpgCAN;
             ucConfigCAN.Dock = DockStyle.Fill;
             tabControl.TabPages.Add(tpgCAN);
         }
     }
 }