mdi form
-
hi all, i am facing a problem in windows mdi form application.how can we know a child form is exist or not. in mdi form i have taken toolstripmenuitem.in that click event i was trying to show a child form1 when we click that menu item for that i am using show method.but when click second time the new child form1 is created.i want show that child only once.if its already it must be restored.how can restore the child form1 if its already exists .and how can we if child form is exist or not. thanks in advance regards obalesu n
-
hi all, i am facing a problem in windows mdi form application.how can we know a child form is exist or not. in mdi form i have taken toolstripmenuitem.in that click event i was trying to show a child form1 when we click that menu item for that i am using show method.but when click second time the new child form1 is created.i want show that child only once.if its already it must be restored.how can restore the child form1 if its already exists .and how can we if child form is exist or not. thanks in advance regards obalesu n
-
thanks for reply, but i could't understand that code .please send cleary. regards obalesu
-
thanks for reply, but i could't understand that code .please send cleary. regards obalesu
you could do something like the following in your clicked_handler. it goes through all mdi childforms....if the one you are trying to open is already opened, it activates the windows and returns. if it's not found, it creates a new mdi childform.
foreach (Form f in this.MdiChildren) { if (f.Name.Equals("mySubForm")) { f.Activate(); return; } } mySubFormn f= new mySubForm(this); f.MdiParent = this; f.Show();