且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在主窗体上的用户控件之间切换的事件处理程序

更新时间:2023-12-06 11:32:52

在某些时候,除了在控件上创建控件外,隐藏和显示"(或使用具有相同效果的Visible属性)是唯一的方法.并从适当的控件"列表中添加或删除它们.

不过,通常,我尝试将它们分组到面板或标签页之类的容器中,并一次控制整个面板的可见性.
At some point, Hide and Show (or by using the Visible Property which has the same effect) is the only way, other than creating the controls on the fly and adding or removing them from the appropriate Controls list.

Generally though, I try to group them into containers such as panels, or tab pages, and control the visibility of the whole panel at a time.