Howdy, Stranger!

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

Categories

Unload form

JeroenJeroen Member Posts: 48
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

  • anna_proganna_prog Member Posts: 1
    : 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!
    :
    :

  • aiijanaiijan Member Posts: 2
    : : 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!
    : :
    : :
    :
    :

  • aiijanaiijan Member Posts: 2
    : : : 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
  • Justin BibJustin Bib USAMember Posts: 0

    // http://forcoder.org // free video tutorials and ebooks about || Ruby, Visual Basic .NET, C#, R, JavaScript, Objective-C, Scratch, Assembly, Delphi, Perl, Go, Python, C, MATLAB, Visual Basic, PL/SQL, Swift, C++, Java, PHP Bash, LabVIEW, Dart, Fortran, F#, VBScript, Scheme, FoxPro, Kotlin, Clojure, Scala, Lua, SAS, Ada, COBOL, Julia, Awk, Logo, Hack, ABAP, Erlang, ML, Alice, Apex, Prolog, Lisp, Transact-SQL, D, Crystal, Rust || _____

Sign In or Register to comment.