我正在使用复选框来设置员工状态,如果用户按下添加并且不选中某个messagebox.show弹出框。如果检查我想要继续。如果复选框被选中,如何跳过消息框
if (chbinactive.Checked == true)
empstatus = "1";
else if(chbinactive.Checked == false)
empstatus = "0";
DialogResult dr = MessageBox.Show("Please note employee status is set to Inactive", "Employee status", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
{
load_database();
}
else if (dr == DialogResult.No)
{
chbinactive.Focus();
return;
}
什么问题面临这个代码? –