Hi,
I have a UserControl with a TextBox in it. TextBox has Validating event
handler that can cancel the validation. If I place two UserControls
like this on a form then Validating event will be firing twice. To
demostrate this I put the following code inside the UserControl.
private int count = 0;
private void textBox1_Validating(object sender, CancelEventArgs
e)
{
e.Cancel = true;
textBox1.Text = (count++).ToString();
}
I can see then the couter growing by 2 every time I try to change focus
from one user control to another.
The behavior is the same in VS.NET2003 and VS2005.
Can anybody explain why it's happening and what could be a fix or
workaround?
Thanks
maks - 24 Jul 2006 14:10 GMT
I figured out that it happens only when using a mouse. When using
keyboard Validating event firing only once as it supposed to do. Looks
like a bug for me...
> Hi,
>
[quoted text clipped - 23 lines]
>
> Thanks