Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make it so when button is clicked a new form pops up!

Status
Not open for further replies.

Mikethegoalie

Programmer
Oct 2, 2003
7
CA
Hi, im pretty familiar with vb 6 but i just purchased vb.net. In vb6 i would usually type: form1.visible = true
or form1.visible = false etc... how can i do that in .net so that when i click a button that a new form pops up! thanks
 
I'm brand new to .net myself, but try:

Dim frmForm1 as New Form1
frmForm1.Show
 
Thanks. It does work. Now outa curiosity, when the new form pops up, how do i get the one behind it to disappear.
Ex. im @ main menu and i click button to go another form, i see the form i desire but the main menu is still behind. any ideas?
 
Below will work:

Dim frmForm2 As New Form2
' the me.hide hides the current form before showing form2
Me.Hide()
frmForm2.Show()

Of course, then you would have to handle showing form1 again on termination of form2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top