Check out example codes for "winforms messagebox with button". It will help you in understanding the concepts better.

Code Example 1

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  
}  

Learn ReactJs, React Native from akashmittal.com