I am using Textbox_Validating event to validate a textbox on one of my window form.
I wanted to validate the textbox, if the text of the texbox changes. So I called the validating event from the textbox_Texchanged event. But it has a sideffect as soon as I press a key it fires the textchanged event and hence the text_Validating event. I want to block the call to Text_Validating if the text property has changed due to keypress. But if someone assings txtbox.Text="asdf";, I want to fire validating event in this case.
private void txt8Ydere1_TextChanged(object sender, EventArgs e)
{
txt8Ydere1_Validating(sender,null);
}
I would use the LostFocus event for the textbox. You could run your validation from that event.
See the msdn for more info.