Unload form

When I load a form in vb.net, and I want to close the first one, the second one also closes.

In vb6 I would do this just with:
form2.show
unload form1 (or me)

In vb.net I used

Dim f1 As New Ingave()
Dim f2 As New uitslag()
f2.Show()
f1.Close()

But now all the forms close.

Can someone help me with this?

THNX!

Comments

  • : When I load a form in vb.net, and I want to close the first one, the second one also closes.
    :
    : In vb6 I would do this just with:
    : form2.show
    : unload form1 (or me)
    :
    : In vb.net I used
    :
    : Dim f1 As New Ingave()
    : Dim f2 As New uitslag()
    : f2.Show()
    : f1.Close()
    :
    : But now all the forms close.
    :
    : Can someone help me with this?
    :
    : THNX!
    :
    :

  • : : When I load a form in vb.net, and I want to close the first one, the second one also closes.
    : :
    : : In vb6 I would do this just with:
    : : form2.show
    : : unload form1 (or me)
    : :
    : : In vb.net I used
    : :
    : : Dim f1 As New Ingave()
    : : Dim f2 As New uitslag()
    : : f2.Show()
    : : f1.Close()
    : :
    : : But now all the forms close.
    : :
    : : Can someone help me with this?
    : :
    : : THNX!
    : :
    : :
    :
    :

  • : : : When I load a form in vb.net, and I want to close the first one, the second one also closes.
    : : :
    : : : In vb6 I would do this just with:
    : : : form2.show
    : : : unload form1 (or me)
    : : :
    : : : In vb.net I used
    : : :
    : : : Dim f1 As New Ingave()
    : : : Dim f2 As New uitslag()
    : : : f2.Show()
    : : : f1.Close()
    : : :
    : : : But now all the forms close.
    : : :
    : : : Can someone help me with this?
    : : :
    : : : THNX!
    : : :
    : : : try reversing the order of the code. that is instead of :

    : : f2.Show() TRY THIS: f1.close() OR me.hide
    : : f1.Close() f2.show()
    :
    there should be a cancel button on each form that you create. the code for that should be me.hide, this closes the form and allows you to select another form to open. hope this helps
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories