MessageBoxButtons 열거형
MessageBox에 표시할 단추를 정의하는 상수를 지정합니다.
네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)
구문
‘선언
Public Enumeration MessageBoxButtons
‘사용 방법
Dim instance As MessageBoxButtons
public enum MessageBoxButtons
public enum class MessageBoxButtons
public enum MessageBoxButtons
public enum MessageBoxButtons
멤버
멤버 이름 | 설명 | |
---|---|---|
AbortRetryIgnore | 메시지 상자에 중단, 다시 시도 및 무시 단추가 있습니다 | |
OK | 메시지 상자에 확인 단추가 있습니다. | |
OKCancel | 메시지 상자에 확인 및 취소 단추가 있습니다. | |
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.
}
}
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
플랫폼
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에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
2.0, 1.1, 1.0에서 지원
.NET Compact Framework
2.0, 1.0에서 지원