CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Posts
    33

    closing .NET form?

    How can I close a .NET form programatically in C#?

  2. #2
    Join Date
    Jan 2003
    Posts
    33
    never mind.......

    myform.Close();

    da...

  3. #3
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    actually, if that's an MDI application and suppose some exception or you want to quit

    so you can use

    Environment.Exit(0);

    also
    - Software Architect

  4. #4
    Join Date
    Nov 2000
    Location
    USA
    Posts
    179
    Application.Exit();

  5. #5
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    "Application.Exit"
    1) when you use Application.Exit then
    Closed and Closing events of form are not invoked. so that you can't test it anyway.

    "Environment.Exit"
    2) actually the process itself is terminated here.

    -Paresh
    - Software Architect

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

Featured