How do I open a form in .net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maxamis4
    Recognized Expert Contributor
    • Jan 2007
    • 295

    How do I open a form in .net

    Simply put I have a button, and I want to open another form with this button, and have it close the currently open form.

    How is this accomplished?

    thanks
  • prenap
    New Member
    • Jan 2007
    • 4

    #2
    This is how I did it:

    Dim ListMng As New frmListMng(data Class)
    ' Display the child form.
    ListMng.MdiPare nt = Me.MdiParent
    ListMng.Show()
    Me.Close()

    Comment

    • maxamis4
      Recognized Expert Contributor
      • Jan 2007
      • 295

      #3
      listMng I assume is the actual form right?

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by prenap
        This is how I did it:

        Dim ListMng As New frmListMng(data Class)
        ' Display the child form.
        ListMng.MdiPare nt = Me.MdiParent
        ListMng.Show()
        Me.Close()

        This code will create a new form and then close the current one...the parent one.

        A much simpler way to do this is to create a form in your project, say frm_test. Then in the button (or whatever the user clicks to open frm_test) just simply put: frm_test.show()

        That will show the form and keep the other window open.

        Have fun coding
        -F

        Comment

        Working...