First, you have to unload or hide the current window (where you will click the button) then show the window that you want to show using it's name.

On the button which will show the next form.

VB 6:

Private Sub Command1_Click()

Me.Hide
Form2.Show()

End Sub

VB 2008:

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Me.Hide()   // this will hide the window where this code is entered
        Form2.Show() //this will display the other window, Form2 is the name,replace it with yours, you can also use Form2.ShowDialog() 

    End Sub
End Class

Haven't tried VB 2010. :-)

just a small corection .

 Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 
Dim A as Form2()     // make the new form to a variable 
Me.Hide()   // this will hide the window where this code is entered
A.Show()     //this will display the other window, Form2 is the name,replace it with yours, you can also use Form2.ShowDialog() 
End Sub
End Class

@killer88,

It seems you were looking for vb.net code, which is a different forum from vb6. :) Irrespective, it seems that your problem was solved, please mark as such, thanx.

This article has been dead for over six months. Start a new discussion instead.