VB.Net Message Box: Types of MessageBox
The VB.Net Message Box displays a dialog box that interrupts the user. It immediately blocks further interaction with Windows Form.
Different Types of VB.Net Message Box
There are different types of MessageBoxes in VB.Net some of them are given below.
Example 1:
To show message box use the following piece of code.
MessageBox.Show( "Your Message Here" )
Example 2:
Message Box with caption and OK button.
MessageBox.Show("Your Message Here", "Caption")
Example 3:
Message Box with OK, Cancel buttons and Stop Icon.
MessageBox.Show("Your Message Here", "Caption", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop)
Example 4:
Message Box with Yes, No, Cancel Buttons and Asterisk icon.
MessageBox.Show("Your Message Here", "Caption", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Asterisk)
Example 5:
Message Box with Retry, Cancel buttons and Warning icon.
MessageBox.Show("Your Message Here", "Caption", MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning)
You may try the various type of message boxes VB.net provides.