如何显示多个组框 [英] how to show multiple group box
本文介绍了如何显示多个组框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我单击按钮1时,组框1显示在位置10,10上,而组框2隐藏在相同的位置10,10上.当我单击按钮2时,组框1隐藏在位置10,10上,而组框2显示在?上.告诉我我该怎么做....
解决方案
看看Groupbox.Visible属性.
你好....
只需按照以下步骤操作即可:
1-通过属性选项卡将groupbox1和groupbox2放在同一位置.
2-为groupbox2设置Visible属性false此 .groupBox2.Visible = false ;
3-为groupbox1设置Visible属性falsethis .groupBox1.Visible = false ;
4- in按钮代码编写此代码:
私有 void btnShowGroupBox1_Click(对象发件人,EventArgs e) { 此 .groupBox1.Visible =!(此 .groupBox2.Visible = 私有 无效 btnShowGroupBox2_Click(对象发件人,EventArgs e) { 此 .groupBox1.Visible =!(此 .groupBox2.Visible =
Have a look at the Groupbox.Visible property.
Hello ....
Just follow this steps :
1- put groupbox1 and groupbox2 in same location via property tab.
2- set Visible attribute false for groupbox2this.groupBox2.Visible = false ;
3- set Visible attribute false for groupbox1this.groupBox1.Visible = false ;
4- in buttons code write this code :
private void btnShowGroupBox1_Click(object sender, EventArgs e) { this.groupBox1.Visible = !(this.groupBox2.Visible = false); } private void btnShowGroupBox2_Click(object sender, EventArgs e) { this.groupBox1.Visible = !(this.groupBox2.Visible = true); }
and Enjoy ....
这篇关于如何显示多个组框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文