I posted the Yes / No / Cancel Messagebox in the FormClosing Method of my form. and now this is the text in the message field: do you want to save the data?
I am not a professional and I don’t know how to handle if the user clicked Cancel ? Exactly, the result of clicking the "Cancel" button should be forms remains open.
How to prevent my form from closing in the FormClosing method ?
I wrote So far :;)
DialogResult dr = MessageBoxFarsi.Show("Do You Want to Save Data?","",MessageBoxButtons.YesNoCancel,MessageBoxIcon.Warning);
else if (dr == DialogResult.Cancel)
{
???
}
Please help me fill out my code!
thanks
source
share