How to detect Help button press in Windows Forms MessageBox?

Posted by sashaeve on Stack Overflow See other posts from Stack Overflow or by sashaeve
Published on 2010-03-09T09:26:43Z Indexed on 2010/05/12 20:14 UTC
Read the original article Hit count: 187

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

var result = MessageBox.Show("text", "title",
                MessageBoxButtons.YesNo,
                MessageBoxIcon.Warning,
                MessageBoxDefaultButton.Button1,
                true);

I can detect if Yes/No buttons where clicked something like this:

if(result == DialogResult.Yes)
    // some actions

How I can detect that Help button was pressed and execute my own code?

© Stack Overflow or respective owner

Related posts about windows-forms

Related posts about messagebox