MessageBoxIcon Enumeration
.NET Framework 2.0
Specifies constants defining which information to display.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
Assembly: System.Windows.Forms (in system.windows.forms.dll)
| Member name | Description | |
|---|---|---|
![]() | Asterisk | The message box contains a symbol consisting of a lowercase letter i in a circle. |
| Error | The message box contains a symbol consisting of white X in a circle with a red background. | |
![]() | Exclamation | The message box contains a symbol consisting of an exclamation point in a triangle with a yellow background. |
![]() | Hand | The message box contains a symbol consisting of a white X in a circle with a red background. |
| Information | The message box contains a symbol consisting of a lowercase letter i in a circle. | |
![]() | None | The message box contain no symbols. |
![]() | Question | The message box contains a symbol consisting of a question mark in a circle. |
| Stop | The message box contains a symbol consisting of white X in a circle with a red background. | |
| Warning | The message box contains a symbol consisting of an exclamation point in a triangle with a yellow background. |
This enumeration is used by the MessageBox class. The description of each member of this enumeration contains a typical representation of the symbol. The actual graphic displayed is a function of the operating system constants. In current implementations there are four unique symbols with multiple values assigned to them.
Private Sub button1_Click(sender As Object, e As System.EventArgs) If textBox1.Text = "" Then MessageBox.Show("You must enter a name.", "Name Entry Error", _ MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Else ' Code to act on the data entered would go here. End If End Sub
protected void button1_Click(Object sender, System.EventArgs e)
{
if (textBox1.get_Text().Equals("")) {
MessageBox.Show("You must enter a name.", "Name Entry Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
else {
// Code to act on the data entered would go here.
}
} //button1_Click
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Community Additions
ADD
Show:
