积极答复者
VC++.NET的MESSAGEBOX问题.

问题
答案
-
请问用的是MFC还是winform?
MFC则用两位斑竹的方法。另外还可以用AfxMessageBox,
int AfxMessageBox(
LPCTSTR lpszText,
UINT nType = MB_OK,
UINT nIDHelp = 0
);
Winform
MessageBox class sample from msdn
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.
}
}
麻烦把正确答案设为解答。- 已标记为答案 Ballsky 2010年3月10日 11:47
全部回复
-
请问用的是MFC还是winform?
MFC则用两位斑竹的方法。另外还可以用AfxMessageBox,
int AfxMessageBox(
LPCTSTR lpszText,
UINT nType = MB_OK,
UINT nIDHelp = 0
);
Winform
MessageBox class sample from msdn
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.
}
}
麻烦把正确答案设为解答。- 已标记为答案 Ballsky 2010年3月10日 11:47