我試圖隱藏的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();
}
}
我想你的代碼,仍然是面板是可見的,此面板包含3 Picture Boxes – Durga
你的孩子形式是由哪種形式創建的? – Damith
GroupSelect(子窗體)由「Form2(父窗體)」創建,GroupExamStart(另一個子窗體)由GroupSelect(子窗體)創建。 – Durga