在C#Windows应用程序中隐藏控件 [英] To Hide a control In C# windows application

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

问题描述



我在C#Windows应用程序中有一个表单.在这种形式下,我有一个文本框和一个按钮.单击此按钮时,我必须显示该文本框,否则必须将其隐藏.

我通过使用属性"Visible"来完成此操作.但是此文本框的空间仍然可用.我也想藏那个空间.

谢谢,
Velkumar

Hi,

I have a form in C# windows application. In this form I have a textbox and button. When I clicked this button I have to show that textbox otherwise I have to hide it.

I have done this by using the property "Visible". but the space for this textbox is still available there. I want to hide that space also.

Thanks,
Velkumar

推荐答案

我不确定,但我认为您可以使用flowlayoutpanel 来实现这一目标.您可能需要删除并添加textbox 而不是将其隐藏.
I am not sure but i think you can use flowlayoutpanel to achieve this. you will perhaps need to remove and add the textbox instead of hiding it.


将Textbox BackGround属性设置为与表单相同,否则将看不到空格
Set the Textbox BackGround Property same as your form then the space wont be seen


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

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