Results 1 to 6 of 6

[C#] Form Help

This is a discussion on [C#] Form Help within the Source Code Samples forums, part of the Programming category; I have 2 forms, one does the auth, and when verified, opens form2 and then form1 needs to close. If ...

  1. #1
    zSteelo is offline Junior Member
    Join Date
    Jul 2009
    Posts
    190

    Default [C#] Form Help

    I have 2 forms, one does the auth, and when verified, opens form2 and then form1 needs to close.

    If I just hide it, when you click the exit button on form2, the program doesn't close (form1 is still in memory). What's the easiest way to fix this?
    Rawr.

  2.   Alt These ads help cover server costs and such.


  3. #2
    Mikah is offline Junior Member
    Join Date
    Jun 2009
    Posts
    50

    Default

    Just add Application.Exit() method to second forms closed event.

  4. #3
    zSteelo is offline Junior Member
    Join Date
    Jul 2009
    Posts
    190

    Default

    What is the closing event?
    Rawr.

  5. #4
    Mikah is offline Junior Member
    Join Date
    Jun 2009
    Posts
    50

    Default

    Click on the form right click go to properties then click the little lightning bolt and scroll down the forms closed event.

  6. #5
    brarei200 is offline Junior Member
    Join Date
    Sep 2009
    Posts
    67

    Default

    Do this for an exit button,

    Code:
    Environment.Exit(0)
    Or put in the form closing even for form2,

    Code:
    form1.close()

  7. #6
    zSteelo is offline Junior Member
    Join Date
    Jul 2009
    Posts
    190

    Default

    Quote Originally Posted by Mikah View Post
    Click on the form right click go to properties then click the little lightning bolt and scroll down the forms closed event.
    Thanks, for some reason the code I had wasn't registering, this made it work.
    Rawr.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Facebook Bots | Admin Forum