Re: TextBox Validating event firing twice



SOLVED

My mistake. I manage the enter key in KeyPress event and I doubled this key
by mistake.

Thank you all !

Dan

<dan@xxxxxxxx> wrote in message
news:OpuL5%23CiFHA.3568@xxxxxxxxxxxxxxxxxxxxxxx
> 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 !
>



.