Multiple Forms

Than again, another way to do it would be to put the following in the scope ( outside of any subs ):
Visual Basic:
Private frm2 As New Form2'Make sure to take off the parenthesis ()
Private frm3 As New Form3'Make 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:
Visual Basic:
MyApplicationsNameHere.frm3.dispose()
then it should work much better....

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

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

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

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

Finally, in the Closing event of Form2:-
Visual Basic:
frm3.dispose
frm4.dispose
'etc etc

Thanks UCM. That's precisely what I needed!! Woohoo!! Happy days! :)

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