if (MessageBox.Show("Do you like Cake?","My Msg box", MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes)
// Do this.....
It returns a DialogResult. Here is the table
Members Description
Abort Return value Abort, usually sent from a button labeled Abort.
Cancel Return value Cancel, usually sent from a button labeled Cancel.
Ignore Return value Ignore, usually sent from a button labeled Ignore.
No Return value No, usually sent from a button labeled No.
None Nothing is returned from the dialog box. The model dialog will continue running.
OK Return value OK, usually sent from a button labeled OK.
Retry Return value Retry, usually sent from a button labeled Retry.
Yes Return value Yes, usually sent from a button labeled Yes.
Here is the list for the Button list
Members Description
AbortRetryIgnore Displays Abort, Retry, and Ignore buttons.
OK Displays OK button only.
OKCancel Displays OK and Cancel buttons.
YesNoCancel Displays Yes, No, and Cancel buttons.
YesNo Displays Yes and No buttons.
RetryCancel Displays Retry and Cancel buttons.
Yui
yuibox.com