我试图隐藏 Panel 控件parent Form2
何时单击按钮GroupSelect childform
打开另一个child form GroupExmStart
,当此 GroupExmStart 表单打开而不是 panel4 应该隐藏并且当它关闭而不是它应该是可见时,我尝试了以下代码,但它不起作用并且什么都没有发生还。我在哪里错了,我该如何以正确的方式做到这一点?
父表格
public partial class Form2 : Form
{
public Control control
{
//using this I accessed panel4 in child form GroupSelect
get {return this.panel4; }
}
}
子表
public partial class GroupSelect : Form
{
private void button1_Click(object sender, EventArgs e)
{
Form2 frm2 = new Form2(lgnName);
frm2.panel4.Visible = false;
GroupExmStart grpexamfrm = new GroupExmStart(GrpID, DurationID, lgnName);
grpexamfrm.MdiParent = this.ParentForm;
//showing another child form and
grpexamfrm.Show();
}
}