How to detect Help button press in Windows Forms MessageBox?

前端 未结 1 1921
北荒
北荒 2021-01-19 02:45

I have a message box with 3 buttons: Yes, No, Help:

var result = MessageBox.Show(\"text\", \"title\",
                MessageBoxButtons.YesNo,
                       


        
相关标签:
1条回答
  • 2021-01-19 03:34

    You want to handle the Form's HelpRequested event. See the example in the help topic.

    public static DialogResult Show(
        string text,
        string caption,
        MessageBoxButtons buttons,
        MessageBoxIcon icon,
        MessageBoxDefaultButton defaultButton,
        MessageBoxOptions options,
        bool displayHelpButton
    )
    
    0 讨论(0)
提交回复
热议问题