Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
' Show the form as a modaless window.
Dim x As Form2 = New Form2
x.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button2.Click
' Show this form as a dialog.
Dim x As Form3 = New Form3
x.ShowDialog(Me)
End Sub
This was first published in January 2004