G
Guest
I have a base form with a Cancel button (btnCancel) and a simple msgbox
routine. I would like to have a routine closing check to prevent loss of
data.
Dim i As Integer
i = MsgBox("Exit?", MsgBoxStyle.YesNo + MsgBoxStyle.Question)
If i = MsgBoxResult.Yes Then
Me.DialogResult = DialogResult.Abort
Me.Dispose()
End If
I have another form that inherits from the base form. In both parent and
decendent the Cancel button property of the form is set to (None).
The problem is this. Even given the above, even given that I've traced the
code and can see that the Me.dispose call is NOT being made when I click No,
the form still closes. Any suggestions as to what I might be overlooking?
routine. I would like to have a routine closing check to prevent loss of
data.
Dim i As Integer
i = MsgBox("Exit?", MsgBoxStyle.YesNo + MsgBoxStyle.Question)
If i = MsgBoxResult.Yes Then
Me.DialogResult = DialogResult.Abort
Me.Dispose()
End If
I have another form that inherits from the base form. In both parent and
decendent the Cancel button property of the form is set to (None).
The problem is this. Even given the above, even given that I've traced the
code and can see that the Me.dispose call is NOT being made when I click No,
the form still closes. Any suggestions as to what I might be overlooking?