in VB.net
If I have 2 forms in a project how do I load the second form using a button in the first form.
Printable View
in VB.net
If I have 2 forms in a project how do I load the second form using a button in the first form.
nevermind resolved it myself....it is a bit different than vb6
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm2 As New Form2()
frm2.Show()
End Sub
note there is not any error handling- apparently you have to declare a new instance of the class Form2 and then .Show() that instance.