Results 1 to 4 of 4

Thread: app close warning

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2003
    Posts
    40

    app close warning

    hello,
    does any one know which windowsform procedure i need to overrirde to control application exiting? for example, to show an "are u sure u want to exit" dialog.

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    VB Code:
    1. Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
    2.         If MessageBox.Show("do you want to save your changes before quiting", Me.Name, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
    3.             e.Cancel = True
    4.         Else
    5.             e.Cancel = False
    6.         End If
    7.     End Sub
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    VB Code:
    1. Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
    2.  
    3. e.Cancel = True '  use this in if block
    4. 'to cancel exiting your app
    5.  
    6. End Sub

  4. #4

    Thread Starter
    Member
    Join Date
    Sep 2003
    Posts
    40
    works like a charm.. thanks, and welcome back pirate

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