MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result = MessageBox.Show("Are there any other products in the carton?", "Question", buttons, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
trans.Rollback();
MessageBox.Show("Please go to the controll room for new packaging", "Message");
frmHome main = new frmHome(empid);
main.Show();
this.Hide();
}
if (result == DialogResult.No)
{
trans.Commit();
frmPalletCartonAllocation pca = new frmPalletCartonAllocation(pack, companyIdNo, skuIdNo, UnitsInCarton, UnitsInPack, carton_Code, orderNo, grvIdNo, empid);
pca.Show();
this.Hide();
}
当消息框出现时,“是”按钮会被突出显示。我希望改为“否”按钮被突出显示。所以默认选项是“否”。
我该怎么做?
MessageBoxDefaultButton
就足以提示了。没有付出任何努力,扣1分。 - user247702