0
我有一個應用程序與mdi。我有父母的一些鏈接,當點擊打開一個新的兒童窗體並隱藏已經打開的窗口 如何檢查孩子是否已經打開?隱藏/顯示MdiChilds
A little scenario:
link 1 -> opens Child of type A
link 2 -> opens Child of type B
link 3 -> open Child of type C
Application start:
click on link 1-> check if a child of type A is opened
- yes -> hides the current opened child and shows the A-type Child
- no: -> hides the current opened child and creates a new A-type child and shows it
click on link 2 -> check if a child of type B is opened
- yes -> hides the current opened child and shows the B-type Child
- no: -> hides the current opened child and creates a new A-type child and shows it
etc..
請問你能用一些代碼嗎?
謝謝...
UPDATE:
這樣的事情?
foreach (Form aForm in this.MdiChildren)
{
aForm.Hide();
}
foreach (Form f in this.MdiChildren)
{
if (f.Name == "VizualizareArticol")
f.Show();
else
{
VizualizareArticol vv = new VizualizareArticol();
vv.MdiParent = this;
vv.StartPosition = FormStartPosition.Manual;
vv.Location = new Point(0, 0);
vv.Show();
}
}
但不工作...
不理解你說的想法 – 2013-03-21 14:23:37
如果你用aForm隱藏一個表單,隱藏它是不可見的。因此,如果(aForm!= null),您可以檢查是否(!aForm.Visible) – Offler 2013-03-21 16:11:26