Guyz, I want to know about the Form Disposed Event. I want that everytime I click the close button ("red X button located at the top right of the form") there will be a message box that asking if I want to exit, then if I click yes the programs ends then if I click No then nothing happens. I also call a function that deactivates the state of the User when I click Yes. The problem is when I click NO, the message box appears but the form has been disposed and the function I called was not execute..How will I do this? Help me guyz...
Here's my script...
Private Sub frmMain_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
If MsgBox("Are you sure you want to exit?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Exit") = MsgBoxResult.Yes Then
Call inactive()
Application.Exit()
Else
End If