Visual Basic.Net

F

Forest_red

How do i hide form1, and show form2 when i click a button on my form in
VB.Net?
I have typed in the code:

form1.hide ()
form2.show()

but that wont work!
Any ideas?!!

Cheers
 
M

Mikk

what type of forms are you talking about? Is it just windows.forms forms or
do you want to display visio windows?

If form1 and from2 ar bothe of type System.Windows.Forms.Form then in order
to show a form you need to first create an instance of it:

Dim myForm as New form2
myForm.Show()

To close a window you should be able to call:

myForm.Close()

or to hide it:

myForm.Hide()

and if you want to unlload the form completely and thus free it's memory
resources you need to call

myForm.Dispose()

I hope this helps...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top