Question how to work with multiple forms

Casper1988

New member
Joined
Dec 15, 2009
Messages
3
Programming Experience
Beginner
i've been working with multiple forms.
here's the situation.. i have 2 forms form1 and form2 every time i show the form2 from the cmd Bttn in form1 then i close and reopen it again it always prompts me with disposal error.,:confused: pls.. somebody help me. im a beginner in vb.net
 
If you use the default instance (Form2.Show) a new one is automatically created. If you need multiple instances you have to create them yourself (Dim f As New Form2, f.Show). If you keep a reference (Private f As Form/Form2) you can check if the instance was disposed (If f.IsDisposed) and conditionally create and assign it a new instance.
 
Back
Top