Multiple form handling in vb.net

Wassi

Newcomer
Joined
Jan 6, 2003
Messages
1
Dear All
Hi

I am workinh invb.net, and as am a biginner so dont mind if i ask a trifle

now , to my problem, say i have 3 vb.net forms A, B and C . A is my main form when i load A i also load B in A's load procedure. now i want to load form C from form B and want to CLOSE form B. Loading is going on fine but how to close form B, i dont know, and also let me know how to close any form itself or through other form.

Thanks

wassi
 
You can close a form via its Close method. If you want to close one form from another, you need a handle to that instance of the form. This is best passed in the constructor, like so:

Visual Basic:
Dim f As Form2 = New Form2(Me)

Then Form2 can retain that passed reference until such time as it needs to use it.
 
Back
Top