MessageBoxButtons-Enumeration
Gibt Konstanten an, die definieren, welche Schaltflächen in MessageBox angezeigt werden.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
Syntax
'Declaration
Public Enumeration MessageBoxButtons
'Usage
Dim instance As MessageBoxButtons
public enum MessageBoxButtons
public enum class MessageBoxButtons
public enum MessageBoxButtons
public enum MessageBoxButtons
Member
Membername | Beschreibung | |
---|---|---|
AbortRetryIgnore | Das Meldungsfeld enthält die Schaltflächen Abbrechen, Wiederholen und Ignorieren. | |
OK | Das Meldungsfeld enthält die Schaltfläche OK. | |
OKCancel | Das Meldungsfeld enthält die Schaltflächen OK und Abbrechen. | |
RetryCancel | Das Meldungsfeld enthält die Schaltflächen Wiederholen und Abbrechen. | |
YesNo | Das Meldungsfeld enthält die Schaltflächen Ja und Nein. | |
YesNoCancel | Das Meldungsfeld enthält die Schaltflächen Ja, Nein und Abbrechen. |
Hinweise
Diese Enumeration wird von der MessageBox-Klasse verwendet.
Beispiel
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
private void button1_Click(object sender, System.EventArgs e) {
if(textBox1.Text == "") {
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.
}
}
private:
void button1_Click( Object^ sender, System::EventArgs^ e )
{
if ( textBox1->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.
}
}
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
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
.NET Compact Framework
Unterstützt in: 2.0, 1.0