Tuesday, November 12, 2019

C# - How to create yes-no question

..last parameter is default button (=second button in dialog).
if ( MessageBox.Show( this, "All data will be deleted. Continue ?",
     "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question, 
     MessageBoxDefaultButton.Button2 ) == DialogResult.No ) return;
Output:

No comments:

Post a Comment