336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
MFC Alert MessageBox
MessageBox 클래스
.NET Framework (current version)
사용자에게 메시지를 보여 주는 메시지 창을 표시합니다. 이 창을 대화 상자라고도 합니다. 이 창은 사용자가 닫을 때까지 응용 프로그램의 다른 동작을 차단하는 모달 창입니다. MessageBox에는 사용자에게 필요한 정보와 명령을 제공하는 텍스트, 단추 및 기호가 포함될 수 있습니다.
어셈블리: System.Windows.Forms.dll의 System.Windows.Forms
private:
void validateUserEntry()
{
// Checks the value of the text.
if ( serverName->Text->Length == 0 )
{
// Initializes the variables to pass to the MessageBox::Show method.
String^ message = "You did not enter a server name. Cancel this operation?";
String^ caption = "No Server Name Specified";
MessageBoxButtons buttons = MessageBoxButtons::YesNo;
System::Windows::Forms::DialogResult result;
// Displays the MessageBox.
result = MessageBox::Show( this, message, caption, buttons );
if ( result == ::DialogResult::Yes )
{
// Closes the parent form.
this->Close();
}
}
}
private:
void Form1_FormClosing(Object^ sender, FormClosingEventArgs^ e)
{
// If the no button was pressed ...
if ((MessageBox::Show(
"Are you sure that you would like to close the form?",
"Form Closing", MessageBoxButtons::YesNo,
MessageBoxIcon::Question) == DialogResult::No))
{
// cancel the closure of the form.
e->Cancel = true;
}
}
'Programming > MFC' 카테고리의 다른 글
| MFC Modal and Modeless Dialog Boxes (0) | 2016.09.06 |
|---|---|
| MFC Alert MessageBox2 (0) | 2016.09.06 |
| MFC Drag And Drop FileName 만 추출 (0) | 2016.08.30 |
| MFC File Icon Drag and Drop (0) | 2016.08.30 |
| MFC Dialog 가 이상한 위치에 배치, (0,0)에 배치 (0) | 2016.08.24 |

