在主窗体上的用户控件之间切换的事件处理程序 [英] event handlers for switching between usercontrols on a master form

查看:68
本文介绍了在主窗体上的用户控件之间切换的事件处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

c#的新手.是否有一种正确"的方法来选择主表单上的不同用户控件,而不是使用.Hide();.和.Show();和方法

New to c#.Is there a "right" way of selecting different user controls on a master form instead of using the .Hide(); and .Show(); method

推荐答案

在某些时候,除了在控件上创建控件外,隐藏和显示"(或使用具有相同效果的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.


这篇关于在主窗体上的用户控件之间切换的事件处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆