G
Guest
Hello to all
I'm handling the Validating event for one text box.
If something is wrong in user input I show a warning message.
The problem is that if I add [e.Cancel=true] to method the message is
displayed twice (event fired twice).
Without [e.Cancel=true] event is fired once.
if(txtMSG.Length > 0)
{
MessageBox.Show(txtMSG, "Warning !", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
e.Cancel = true;
}
Can you help me ?
Thank you !
I'm handling the Validating event for one text box.
If something is wrong in user input I show a warning message.
The problem is that if I add [e.Cancel=true] to method the message is
displayed twice (event fired twice).
Without [e.Cancel=true] event is fired once.
if(txtMSG.Length > 0)
{
MessageBox.Show(txtMSG, "Warning !", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
e.Cancel = true;
}
Can you help me ?
Thank you !