I find various questions on the forum related to the MessageBox handling. Although it is very simple, but just to help the guys who are not much aware about it, i am posting this code snippet. If you found any issue, then please let me know
int iDialogResult = (int)MessageBox.Show("Do you want to perform different actions?", "Actions", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (iDialogResult == (int)DialogResult.Yes) { MessageBox.Show("You click YES", "YES"); } else if (iDialogResult == (int)DialogResult.No) { MessageBox.Show("You click NO", "NO"); } else { MessageBox.Show("You click CANCEL", "CANCEL"); }
|
No responses found. Be the first to respond and make money from revenue sharing program.
|