Results 1 to 11 of 11

Thread: [RESOLVED] How do i open another window and close the avtive window when i hit a button ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2008
    Posts
    195

    Resolved [RESOLVED] How do i open another window and close the avtive window when i hit a button ?

    As seen in the attached Picture. When i hit the button Calculate i want to open another window and close the active window , How can i do that in an easy way ?
    Attached Images Attached Images  

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: How do i open another window and close the avtive window when i hit a button ?

    First you need to make sure that Shutdown Mode is set to "When last form closes" in your projects properties.
    Then just create an instance of the form you want to show, call its Show method, and close the current form.
    vb Code:
    1. Dim someForm As New Form2
    2. someForm.Show()
    3. Me.Close
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2008
    Posts
    195

    Re: How do i open another window and close the avtive window when i hit a button ?

    Where do i fine that ?

    Shutdown Mode is set to "When last form closes"

  4. #4
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: How do i open another window and close the avtive window when i hit a button ?

    In the project properties. Should be the last option in the Project menu.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2008
    Posts
    195

    Re: How do i open another window and close the avtive window when i hit a button ?

    I dont See that Buddy ,


  6. #6
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: How do i open another window and close the avtive window when i hit a button ?

    Thats the forms properties, Im talking about the Project properties in the "Project" menu
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Mar 2008
    Posts
    195

    Re: How do i open another window and close the avtive window when i hit a button ?

    THANKS. Now to add another forum so i can add the following code do i do this ?


    then 2-click on Calculate and add this

    Dim someForm As New Form2
    someForm.Show()
    Me.Close

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Mar 2008
    Posts
    195

    Re: How do i open another window and close the avtive window when i hit a button ?

    Can someone help me out here ?

  9. #9
    Fanatic Member Clanguage's Avatar
    Join Date
    Jan 2008
    Location
    North Carolina
    Posts
    659

    Re: How do i open another window and close the avtive window when i hit a button ?

    In Solution Explorer on your right double click on My Project it will open the properties. The shutdown option is the item next to last.
    CLanguage;
    IF Post = HelpFull Then
    RateMe
    Else
    Say("Shut UP")
    End If
    DotNet rocks
    VB 6, VB.Net 2003, 2005, 2008, 2010, SQL 2005, WM 5.0,ahem ?OpenRoad?

  10. #10
    Fanatic Member onlyGirl's Avatar
    Join Date
    Sep 2006
    Location
    Houston, TX
    Posts
    743

    Re: How do i open another window and close the avtive window when i hit a button ?

    Right click on your spur gear program in the solution explorer and you should have options of adding a windows form and so on.
    Using Visual Studio 2008

    Please mark your thread RESOLVED if you no longer need help.

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Mar 2008
    Posts
    195

    Re: [RESOLVED] How do i open another window and close the avtive window when i hit a button ?

    Thanx ...

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