Results 1 to 8 of 8

Thread: Application ending when start up is closed

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    Application ending when start up is closed

    I have a logon screen that is my start-up form. With a successful logon the user is taken to a MDI Parent form where they can choose what they need to do from the menu. The problem is how do I stop the application from ending when the logon start up form is closed. It ends the app if I use me.close or click the X button on the form....any suggestions?


    thanks,
    eye
    Last edited by EyeTalion; Aug 15th, 2002 at 08:51 AM.

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    why not make the mdi form the startup, have it load the login form?
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    dont want to let them into the application until a successful login.

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    you can keep it hidden until you need it.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    but I'm only going to need it in the begining. After they login, I'm not going to need that form anymore. Could I make the Sub_Main my start up and then have it call the login form then use a me.close?

  6. #6
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    sure you can do that..then do this

    Application.Run(loginform)
    Application.Run(themdiform)

    what will happen is full control will goto loginform. When you close loginform, the next line in sub main will fire giving control to the mdi.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  7. #7
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    by the way that should System.Windows.Forms.Application.Run

    or import System.Windows.Forms into your sub main module
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  8. #8

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    still not working. When I close the login screen the MDI closes with it too, and it's not the start up anymore. Another question, when creating an instance of a form....

    frmLogon1 = New frmLogon

    do I need to do this everytime I call a form? If I don't I get an error.


    thanks,
    eye

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