相关疑难解决方法(0)

Hiding and Showing TabPages in tabControl

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?

vb.net tabcontrol tabpage

35
推荐指数
4
解决办法
13万
查看次数

TabPage.Hide()做什么?

我想隐藏TabControl中的TabPage.

我试过这种方式:

MyTabControls.TabPages[1].Hide();
Run Code Online (Sandbox Code Playgroud)

它没有隐藏.

所以我搜索并看到应删除它并在需要时重新创建:如何从TabControl隐藏TabPage

在这种情况下,Hide功能在做什么?

截图:

在此输入图像描述

.net c# tabcontrol winforms

5
推荐指数
2
解决办法
2万
查看次数

标签 统计

tabcontrol ×2

.net ×1

c# ×1

tabpage ×1

vb.net ×1

winforms ×1