隐藏和显示 TableLayoutPanel 的单元格 [英] Hide and show a cell of the TableLayoutPanel
问题描述
我的 tablelayout 面板有 1 列和 3 行.(一个停靠在每个单元格中的填充面板.)
My tablelayout panel has one column and three rows. (one docked to Fill panel in each cell.)
现在我希望能够隐藏/显示行.我希望在任何时候都只显示一行(基于用户对某些单选按钮的选择),并且我希望调整大小以填充 TableLayoutPanel 的所有区域.
Now I would like to be able to hide/show the rows . I want only one row to be visible at any time ( based on a user selection of some radio buttons) and I want to to get resized so it fills all the area of the TableLayoutPanel.
我该怎么做?有什么想法吗?
How can I do that? Any thoughts?
推荐答案
那么你为什么要使用 TableLayoutPanel
?
So why did you use a TableLayoutPanel
?
只需在你的表单上放三个Panel
,将每一行的内容填入每个人,并将所有三个面板的Dock
属性设置为Fill代码>.将两个面板设置为
Visible = false
,一个设置为 true
.
Just put three Panel
s on your form, fill in everyone the content of each row and set the Dock
property of all three panels to Fill
. Set two panels Visible = false
and one to true
.
如果您想看到另一个面板,只需使其可见并隐藏其他两个(根据您的单选按钮设置).
If you like to see another panel, just make it visible and hide the other two (based on your radio button settings).
这篇关于隐藏和显示 TableLayoutPanel 的单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!