Spawning multiple forms

Rephistorch

Member
Joined
Oct 4, 2005
Messages
16
Programming Experience
3-5
I don't know if you can do this in Visual basic but is there any way to make your program open itself (like a form starting that same form on the screen) Sorry if that's not clear but basically i want my form to open itself more than once. Thanks for any replies.
 
Last edited:
Why not ... say your form is named Form1 and you want to open it again and again ... just do the next:
VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] newForm [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Form
newForm = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Form1
newForm.Show()
[/SIZE]

If you join this code to the button it will open the same form (actually it is not the same form but rather new instance of certain class if you know what i mean) every time you click the button

HTH
Regards ;)


edit: hey wellcome to the forum !
 
Thank you so much for your help. I shall put this into my code tommorow. jmcilhinney, kulrom has already answered my question, but thanks for your interest.
 
Last edited:
Back
Top