unload

  • Thread starter Thread starter Maarten
  • Start date Start date
M

Maarten

hi all,

if i close my form, withe the close button in the frame, i want a messagebox
displaying "are you shure"

how do i do this, i see that the unload statement is gone

kind regards,
Maarten
 
Maarten said:
if i close my form, withe the close button in the frame, i want a
messagebox displaying "are you shure"

\\\
Private Sub Form1_Closing( _
ByVal sender As Object, _
ByVal e As CancelEventArgs _
) Handles MyBase.Closing
If _
MsgBox( _
"Really close?", _
MsgBoxStyle.YesNo Or MsgBoxStyle.Question _
) = MsgBoxResult.No _
Then
e.Cancel = True
End If
End Sub
///
 
thanks for the code,but

I get an error (underlined) in the CancelEventArgs

regards,
Maarten
 
Maarten said:
I get an error (underlined) in the CancelEventArgs

Add 'Imports System.ComponentModel' to the imports section of your VB file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top