コード例 #1
0
        internal void AddTab(string nameTab, int imageIndex, VisualControl controlForPage)
        {
            if (controlForPage != null)
            {
                controlForPage.Visible = false;
            }

            VCTabButton btnTab = new VCTabButton(this, leftForNextPage, 0, BitmapList, imageIndex)
            {
                NameTab     = nameTab,
                IndexPage   = btnTabs.Count,
                ContextPage = controlForPage
            };

            btnTabs.Add(btnTab);

            if (controlForPage != null)
            {
                AddControl(controlForPage);
                controlForPage.ShiftX = 0;
                controlForPage.ShiftY = lblCaptionPage.NextTop();
            }

            leftForNextPage += btnTab.Width + FormMain.Config.GridSizeHalf;

            if (ActivePage == -1)
            {
                ActivatePage(0);
            }
        }
コード例 #2
0
        internal void ActivatePage(int indexPage)
        {
            if (activePage?.IndexPage != indexPage)
            {
                ActivePage = indexPage;

                if ((activePage != null) && (activePage.ContextPage != null))
                {
                    activePage.ContextPage.Visible = false;
                }

                activePage          = btnTabs[indexPage];
                lblCaptionPage.Text = activePage.NameTab;

                if ((activePage != null) && (activePage.ContextPage != null))
                {
                    activePage.ContextPage.Visible = true;
                }

                Program.formMain.NeedRedrawFrame();
            }
        }