Esempio n. 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();
        }
Esempio n. 2
0
        void BackToFront_SelButton()
        {
            int i = 0;

            TabButtonPanel.Controls.Clear();
            btstrlist.Clear();
            for (i = 0; i < buttonlist.Count; i++)
            {
                btstrlist.Add(buttonlist[i].Text);
            }

            buttonlist.Clear();

            for (int j = 0; j < btstrlist.Count; j++)
            {
                if (j == 0)
                {
                    ButtonX bx = new ButtonX();
                    bx.DisplayText          = btstrlist[j];
                    bx.Text                 = btstrlist[j];
                    bx.Size                 = tab_size;
                    bx.Location             = new Point(0, 0);
                    bx.ForeColor            = sel_tab_forecolor;
                    bx.BXBackColor          = sel_tab_backcolor;
                    bx.MouseHoverColor      = sel_tab_backcolor;
                    bx.MouseClickColor1     = sel_tab_backcolor;
                    bx.ChangeColorMouseHC   = false;
                    bx.TextLocation_X       = txt_x_loc;
                    bx.TextLocation_Y       = txt_y_loc;
                    bx.Font                 = this.Font;
                    bx.Click               += button_Click;
                    bx.OnClickCloseHandler += Close_Button;
                    TabButtonPanel.Controls.Add(bx);
                    buttonlist.Add(bx);
                    selected_index++;
                }
                else if (j > 0)
                {
                    ButtonX bx = new ButtonX();
                    bx.DisplayText          = btstrlist[j];
                    bx.Text                 = btstrlist[j];
                    bx.Size                 = tab_size;
                    bx.ForeColor            = sel_tab_forecolor;
                    bx.BXBackColor          = sel_tab_backcolor;
                    bx.MouseHoverColor      = sel_tab_backcolor;
                    bx.MouseClickColor1     = sel_tab_backcolor;
                    bx.ChangeColorMouseHC   = false;
                    bx.TextLocation_X       = txt_x_loc;
                    bx.TextLocation_Y       = txt_y_loc;
                    bx.Font                 = this.Font;
                    bx.Click               += button_Click;
                    bx.OnClickCloseHandler += Close_Button;
                    bx.Location             = new Point(buttonlist[j - 1].Size.Width + buttonlist[j - 1].Location.X, 0);
                    TabButtonPanel.Controls.Add(bx);
                    buttonlist.Add(bx);
                    selected_index++;
                }
            }
            TabPanel.Controls.Clear();
        }
Esempio n. 3
0
        void createAndAddButton(string tabtext, TabPanelControl tpcontrol, Point loc, bool showCloseButton)
        {
            ButtonX bx = new ButtonX();

            bx.DisplayText = tabtext;
            bx.Text        = tabtext;
            //  bx.Size = tab_size;
            int width = TextRenderer.MeasureText(tabtext, this.Font).Width + 20;

            if (width < tab_size.Width)
            {
                width = tab_size.Width;
            }
            bx.Size = new Size(width, tab_size.Height);

            bx.Location           = loc;
            bx.ForeColor          = sel_tab_forecolor;
            bx.BXBackColor        = sel_tab_backcolor;
            bx.MouseHoverColor    = sel_tab_backcolor;
            bx.MouseClickColor1   = sel_tab_backcolor;
            bx.ChangeColorMouseHC = false;
            bx.TextLocation_X     = txt_x_loc;
            bx.TextLocation_Y     = txt_y_loc;
            bx.Font                 = this.Font;
            bx.Click               += button_Click;
            bx.ShowCloseButton      = showCloseButton;
            bx.OnClickCloseHandler += Close_Button;
            TabButtonPanel.Controls.Add(bx);

            buttonlist.Add(bx);
            selected_index++;

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

            UpdateButtons();
        }
Esempio n. 4
0
        public void ChangeTabText(string newtext, int index)
        {
            ButtonX but = buttonlist[index];

            but.Text = newtext;
        }