Пример #1
0
        void tbr_Click(object sender, EventArgs e)
        {
            int i;

            for (int k = 0; k < ((ToolStripMenuItem)sender).MergeIndex; k++)
            {
                int j = 0;
                for (i = ((ToolStripMenuItem)sender).MergeIndex; i >= 0; i--)
                {
                    ButtonX but  = buttonlist[i];
                    ButtonX temp = buttonlist[j];
                    buttonlist[i] = temp;
                    buttonlist[j] = but;

                    TabPanelControl uct1    = tabPanelCtrlList[i];
                    TabPanelControl tempusr = tabPanelCtrlList[j];
                    tabPanelCtrlList[i] = tempusr;
                    tabPanelCtrlList[j] = uct1;
                }
            }

            string btext = ((ToolStripMenuItem)sender).Text;

            BackToFront_SelButton();
            selected_index = 0;
            TabPanel.Controls.Add(tabPanelCtrlList[buttonlist[0].TabIndex]);
            UpdateButtons();
        }
Пример #2
0
        void createAndAddButton(string tabtext, TabPanelControl tpcontrol, Point loc)
        {
            ButtonX bx = new ButtonX();

            bx.DisplayText        = tabtext;
            bx.Text               = tabtext;
            bx.Size               = new Size(130, 30);
            bx.Location           = loc;
            bx.ForeColor          = Color.White;
            bx.BXBackColor        = Color.FromArgb(20, 120, 240);
            bx.MouseHoverColor    = Color.FromArgb(20, 120, 240);
            bx.MouseClickColor1   = Color.FromArgb(20, 80, 200);
            bx.ChangeColorMouseHC = false;
            bx.TextLocation_X     = 10;
            bx.TextLocation_Y     = 9;
            bx.Font               = this.Font;
            bx.Click             += button_Click;
            TabButtonPanel.Controls.Add(bx);
            buttonlist.Add(bx);
            selected_index++;

            tabPanelCtrlList.Add(tpcontrol);
            TabPanel.Controls.Clear();
            TabPanel.Controls.Add(tpcontrol);

            UpdateButtons();
        }
Пример #3
0
 public void AddTab(string tabtext, TabPanelControl tpcontrol)
 {
     if (!buttonlist.Any())
     {
         createAndAddButton(tabtext, tpcontrol, new Point(0, 0));
     }
     else
     {
         createAndAddButton(tabtext, tpcontrol,
                            new Point(buttonlist[buttonlist.Count - 1].Size.Width +
                                      buttonlist[buttonlist.Count - 1].Location.X, 0));
     }
 }