Multiple Forms

Than again, another way to do it would be to put the following in the scope ( outside of any subs ):
Code:
Private frm2 As New Form2Make sure to take off the parenthesis ()
Private frm3 As New Form3Make sure to take off the parenthesis ()
and ignore the whole (frm3.mdiParent=Me) thing...

Then make a public sub in form2 that would clear the contents of form2...

Now you can call from anywhere in form1 to show form2 and form3...

then if you put in the _closing event of form2:
Code:
MyApplicationsNameHere.frm3.dispose()
then it should work much better....

see how I do something like this in This Thread
 
Minor modification to above, dont use.Dispose(), if you do then the form will dissappear permanantly and youll have to call Private frm# as new form# again....

Instead, use.Hide() and .Show()...
 
CRACKED IT!

In Form2 (UserManager) I declared :-
Code:
Public frm3 as Form3
Public frm4 as form4
etc etc

Then in the Activated method of Form3, form4 etc etc I have:-
Code:
frm2.frm3=Me
frm2.frm4=Me

Finally, in the Closing event of Form2:-
Code:
frm3.dispose
frm4.dispose
etc etc

Thanks UCM. Thats precisely what I needed!! Woohoo!! Happy days! :)

I think Im beginning to get the hang of this OOP lark!
 
Back
Top