我如何以编程方式单击MessageBox上的按钮

问题描述 投票:-1回答:2

我检查时有一个单选按钮,它应该显示一条消息

DialogResult click = MessageBox.Show("Would you like to convert the actual values to US Customary ?\n Clicking No changes just the unit system.", "Change Unit Systems to US Customary", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

if (click == DialogResult.Yes)
{
    //some code 
}

如何从按钮中的内部代码答复此消息,否则为否?

c# winforms messagebox
2个回答
0
投票

我不想显示消息


-1
投票

单击单选按钮时,将发送适当的委托函数(操作)和消息框结果。该操作处理是/否情况。

© www.soinside.com 2019 - 2024. All rights reserved.