Beispiel #1
0
 /// <summary>
 /// Loads the given tab control into this display.
 /// </summary>
 /// <param name="tabControl">The tabcontrol that will be loaded by this display</param>
 public void AttachTabControl(NewTabControl tabControl)
 {
     TabControl = tabControl;
     tabControl.SelectedIndexChanged += (sender, eventArgs) => {
         string tabName = tabControl.SelectedIndex != -1 ? tabControl.TabPages[TabControl.SelectedIndex].Text.TrimStart('*') : null;
         DisplayTabChanged?.Invoke(tabName);
     };
     tabControl.TabXClicked += (sender, eventArgs) => {
         DisplayTabClosing?.Invoke(((TabPage)sender).Text.TrimStart('*'));
     };
     pnlMain.Controls.Add(TabControl, 0, 0);
     TabControl.Dock = DockStyle.Fill;
 }
Beispiel #2
0
 /// <summary>
 /// Loads the given tab control into this display.
 /// </summary>
 /// <param name="tabControl">The tabcontrol that will be loaded by this display</param>
 public void AttachTabControl(NewTabControl tabControl)
 {
     TabControl = tabControl;
     TabControl.SelectedIndexChanged += (sender, eventArgs) => {
         string tabName = TabControl.SelectedIndex != -1 ? TabControl.TabPages[TabControl.SelectedIndex].Text : null;
         if (tabName != null)
         {
             UpdateTickControls(!tabName.Contains("."));
         }
         DisplayTabChanged?.Invoke(tabName);
     };
     TabControl.TabXClicked += (sender, eventArgs) => {
         DisplayTabClosing?.Invoke(((TabPage)sender).Text);
     };
     pnlMain.Controls.Add(pnlOutputControls, 0, 0);
     pnlMain.Controls.Add(TabControl, 0, 1);
     TabControl.Dock = DockStyle.Fill;
 }