RSS

Prompt a MessageBox for confirmation

06 Mar

I need a MessageBox with OK and Cancel buttons for users to confirm. Here is an easy sample:

Dim result As DialogResult
result = MessageBox.Show("Are you sure this is OK?", "MyTitle", MessageBoxButtons.OKCancel, Nothing, MessageBoxDefaultButton.Button1)

If result = DialogResult.OK Then
    ' User presses OK button.
    ' Do something.
End If
Advertisements
 
Leave a comment

Posted by on March 6, 2012 in .NET, VB

 

Tags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: