Results 1 to 3 of 3

Thread: Basic form closing question..

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2011
    Posts
    6

    Basic form closing question..

    EDIT: I figured it out!

    I have two forms: Frontpage, and Main

    When my program starts, Frontpage is loaded, and it has a button to continue (It contains some instructions)

    It then opens Main, and that works, but I cannot get Frontpage to close without terminating my whole program...

    How can I close Frontpage without ending my program? I don't want to just hide it, because if I do that then once I close Main it keeps the program running...

    Thanks,
    Ryan
    Last edited by Carbunkulous; Apr 14th, 2011 at 07:32 PM. Reason: Resolved

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2011
    Posts
    6

    Re: Basic form closing question..

    Bah! I managed to get it! Haha

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Basic form closing question..

    It's considered good form to provide your solution if you figure it out for yourself, such that it might help others with the same issue. To that end, there is an option on the Application page of the project properties that controls when the application closes. That must specify when the last form closes, rather than when the startup form closes. You must then ensure that you open the next form before closing the current.

    That said, there's probably a better way when the first form isn't your main form. Select the second form as the startup form and then display the other form as a modal dialogue from the Startup event handler of the application. That way, the application will still exit when the startup form closes, which is usually what you want. The other option is generally for dialogue-based apps, which are essentially wizards.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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