Customizing a TabControl for the Closing of Individual Tabs

前端 未结 7 1337
囚心锁ツ
囚心锁ツ 2020-12-06 10:33

My scenario is the following:

I am working on a winforms application in C# that has a button inside the main page of a tabcontrol that will generate another tabpag

7条回答
  •  时光说笑
    2020-12-06 10:46

    It´s works!

    TabPage tabpage = (TabPage)this.Parent;
    TabControl tabControl = (TabControl)tabpage.Parent;
    tabControl.TabPages.Remove(tabpage);
    

提交回复
热议问题