Answers for "winforms messagebox with button"

C#
2

winforms messagebox with button

string message = "Do you want to close this window?";  
string title = "Close Window";  
MessageBoxButtons buttons = MessageBoxButtons.YesNo;  
DialogResult result = MessageBox.Show(message, title, buttons);  
if (result == DialogResult.Yes) {  
    this.Close();  
} else {  
    // Do something  
}  
Posted by: Guest on April-03-2020

C# Answers by Framework

Browse Popular Code Answers by Language