VB.Net Closing From


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: VB.Net Closing From

Hybrid View

  1. #1
    Join Date
    May 2005
    Posts
    1

    VB.Net Closing From

    I am having trouble closing a form. Here is the scenario:

    '------------- Code Sample ------------
    Private Sub frmMain_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
    e.Cancel = True
    Me.Visible = False
    End Sub
    '--------------------------------------

    When the form Close button is clicked, the form closing event is cancelled and the form is minimized to the Notification area. The user can exit the program by selecting the appropriate menu option. This all works as it should.

    The problem arises when Windows attempts to close the program when shutting down or restarting Windows.

    How can i differentiate between a user clicking the form Close button and the system trying to close the application?

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    See if this helps:
    http://www.ftponline.com/archives/pr...111/qa0111.asp
    (free registration (or bugmenot.com) required)
    Last edited by Phil Weber; 05-09-2005 at 09:29 PM.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center