MessageBoxButtons 列挙体
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Public Enumeration MessageBoxButtons

メンバ名 | 説明 | |
---|---|---|
![]() | AbortRetryIgnore | メッセージ ボックスに [中止]、[再試行]、および [無視] の各ボタンを含めます。 |
![]() | OK | メッセージ ボックスに [OK] ボタンを含めます。 |
![]() | OKCancel | メッセージ ボックスに [OK] ボタンと [キャンセル] ボタンを含めます。 |
![]() | RetryCancel | メッセージ ボックスに [再試行] ボタンと [キャンセル] ボタンを含めます。 |
![]() | YesNo | メッセージ ボックスに [はい] ボタンと [いいえ] ボタンを含めます。 |
![]() | YesNoCancel | メッセージ ボックスに [はい]、[いいえ]、および [キャンセル] の各ボタンを含めます。 |

この列挙体は MessageBox クラスで使用されます。

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. } }

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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- MessageBoxButtons 列挙体のページへのリンク