Results 1 to 2 of 2

Thread: load a second form from first form...[RSOLVED]

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2004
    Posts
    5

    load a second form from first form...[RSOLVED]

    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.
    Last edited by marq; Jan 8th, 2004 at 11:20 PM.

  2. #2

    Thread Starter
    New Member
    Join Date
    Jan 2004
    Posts
    5
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width