Example #1
0
        private void forceCloseTab(object sender, TabCloseTabEventArgs e)
        {
            tabPages[e.IndexTab].OnClosedTab();
            panHTabHeader.Controls[e.IndexTab].Dispose();
            tabPages[e.IndexTab].Dispose();
            tabPages.RemoveAt(e.IndexTab);
            panMain.Controls.Clear();
            lsbRemoveAt(e.IndexTab);


            panHTabHeader.Size = new System.Drawing.Size(panHTabHeader.Size.Width - wtab,
                                                         panHTabHeader.Size.Height);

            lentab -= wtab;

            if (e.IndexTab == panHTabHeader.Controls.Count)
            {
                tabIndex = (e.IndexTab > 0) ? e.IndexTab - 1 : -1;
            }
            else
            {
                for (int i = tabIndex; i < panHTabHeader.Controls.Count; ++i)
                {
                    panHTabHeader.Controls[i].Location = new Point(panHTabHeader.Controls[i].Location.X - wtab + 1,
                                                                   panHTabHeader.Controls[i].Location.Y);
                }
            }

            changeIndaxTabInTabPage();

            selectTab(tabIndex);
            tabSizeChangd();
        }
Example #2
0
        public void ForceCloseTabPage()
        {
            EventHandler <TabCloseTabEventArgs> handle = ForceCloseTab;
            TabCloseTabEventArgs e = new TabCloseTabEventArgs();

            e.IndexTab = DynamicTabIndex;
            e.UniqueId = UniqueId;
            if (handle != null)
            {
                handle(this, e);
            }
        }
Example #3
0
        private void onCloseTab(int idx, int uniqueId, TabPageType tPageType)
        {
            TabCloseTabEventArgs e = new TabCloseTabEventArgs();

            e.IndexTab = idx;
            e.UniqueId = uniqueId;
            e.TabPage  = tPageType;
            EventHandler <TabCloseTabEventArgs> handler = ClosingTab;

            if (handler != null)
            {
                handler(this, e);
            }
        }