I am trying to show or hide tabpages as per user choice. If user selects gender male then form for male in a tabpage "male" should be displayed and if user selects female then similar next form should be displayed in next tab "female"
I tried using
tabControl1.TabPages.Remove(...)
Run Code Online (Sandbox Code Playgroud)
and
tabControl1.TabPages.Add(...)
Run Code Online (Sandbox Code Playgroud)
It adds and removes the tabpages but doing so will loose my controls on tabpages too... i can't see them back. what's the problem here?
我想隐藏TabControl中的TabPage.
我试过这种方式:
MyTabControls.TabPages[1].Hide();
Run Code Online (Sandbox Code Playgroud)
它没有隐藏.
所以我搜索并看到应删除它并在需要时重新创建:如何从TabControl隐藏TabPage
在这种情况下,Hide功能在做什么?
截图:
