i created an exitstrip tool on my system and i want my system to ask the user
if he/she really wants to exit the application. but when i add a command on
the forms close button my exitstrip tool doesn't work well. this is my
command on my exitstrip tool:
Private Sub ExitToolStripMe nuItem1_Click(B yVal sender As System.Object, ByVal
e As System.EventArg s) Handles ExitToolStripMe nuItem1.Click
Flag = True
If MessageBox.Show ("Do you really want to exit this application?", "",
MessageBoxButto ns.YesNo) = Windows.Forms.D ialogResult.Yes Then
Me.Close()
Else
TextBox3.Focus( )
End If
End Sub
and this is my command on my close button:
Private Sub Form3_FormClosi ng(ByVal sender As System.Object, ByVal e As
System.Windows. Forms.FormClosi ngEventArgs) Handles MyBase.FormClos ing
If MessageBox.Show ("Do you really want to exit this application?", "",
MessageBoxButto ns.YesNo) = Windows.Forms.D ialogResult.No Then
e.Cancel = True
End If
End Sub
is there something wrong on my codes?
--
Message posted via DotNetMonster.c om
if he/she really wants to exit the application. but when i add a command on
the forms close button my exitstrip tool doesn't work well. this is my
command on my exitstrip tool:
Private Sub ExitToolStripMe nuItem1_Click(B yVal sender As System.Object, ByVal
e As System.EventArg s) Handles ExitToolStripMe nuItem1.Click
Flag = True
If MessageBox.Show ("Do you really want to exit this application?", "",
MessageBoxButto ns.YesNo) = Windows.Forms.D ialogResult.Yes Then
Me.Close()
Else
TextBox3.Focus( )
End If
End Sub
and this is my command on my close button:
Private Sub Form3_FormClosi ng(ByVal sender As System.Object, ByVal e As
System.Windows. Forms.FormClosi ngEventArgs) Handles MyBase.FormClos ing
If MessageBox.Show ("Do you really want to exit this application?", "",
MessageBoxButto ns.YesNo) = Windows.Forms.D ialogResult.No Then
e.Cancel = True
End If
End Sub
is there something wrong on my codes?
--
Message posted via DotNetMonster.c om
Comment