如何在Windows窗体应用程序中隐藏对象 [英] How Do I Hide Objects In Windows Form Application

查看:109
本文介绍了如何在Windows窗体应用程序中隐藏对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

i正在使用带有C#的Windows窗体应用程序使用VS20012 asp.net



我在外面有一些对象tabcontrol的。

当我转到第一个标签时,对象需要可见,但是当我转到第二个标签时,对象需要隐藏。然后我去第一个标签,对象需要再次可见。



请参阅下面的图片。

当我点击page1,标签和组合框应该是可见的,但当我点击标签页2时,它需要隐藏。



http://s30.postimg.org/boubpttqp/tab_control.jpg [ ^ ]



提前谢谢。

dear all,
i am working with a windows forms application with C# using VS20012 asp.net

where i have some objects outside of the tabcontrol.
when i go to first tab the objects need to visible, but when i go to second tab the objects need to be hide. then i go to first tab, the objects need to visible again.

pls see the pic below.
when i click the page1, the label and combobox should be visible but when i click the tab page2 it needs to be hide.

http://s30.postimg.org/boubpttqp/tab_control.jpg[^]

thank you in advance.

推荐答案

将您尝试隐藏的控件放在Panel控件中。当选项卡更改为第二个选项卡时,隐藏面板。其中的所有控件也将消失。当需要再次显示控件时,显示面板。这很简单。



每个控件都有一个Visible属性。阅读相关文档。或者您可以使用控件上的显示和隐藏方法,包括Panel控件。
Put the controls you're trying to hide in a Panel control. When the tab changes to the second tab, hide the panel. All the controls in it will also disappear. When the controls need to be shown again, show the panel. It's easy.

Every control has a Visible property. Read the documentation on it. Or you can use the Show and Hide methods on the control, including the Panel control.


这篇关于如何在Windows窗体应用程序中隐藏对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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