the closing event is triggered when the form is already being closed so I don't think that using me .close will have any effect in your program.
I would suggest that you put that code inside a button event instead of closing event of the form.
vb Code:
private sub button1_click()sender as object, e as eventArgs) Handles button1.click If MessageBox.Show("Do you want to exit application completely?", "Quit Form", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then 'do nothing Application.Exit() Else 'e.Cancel = True Me.Close() End If end sub




Reply With Quote