DialogResult result=MessageBox.Show("确定删除吗?","删除",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
if(result==DialogResult.Yes){
//删除操作
}else{
return;
}
if (MessageBox.Show("确定要删除货号" + "[" + dr["goods_sn"] + "]吗?", "此删除不可恢复", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
//代码
}
else
{
//代码
}
MessageBox.Show
("表格中没有数据不能导出","提示",MessageBoxButtons.OK,MessageBoxIcon.Information );
if(MessageBox.Show(this, "demo", "text", MessageBoxButtons.YesNo) == DialogResult.No)
{}
if (MessageBox.Show("Delete this user?", "Confirm Message", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
//delete
}
标签:C#,MessageBox,show