text box validating event is not firing

madhugp

Member
Joined
Nov 27, 2017
Messages
20
Programming Experience
5-10
my code is as follow

private void textBox1_Validating(object sender, CancelEventArgs e)
{

MessageBox.Show("text box validating event");
MessageBox.Show(textBox1.Text);


}

I am entering some value in text box and press tab key , the cursor navigates to the next text box, but there is no response
to the event. my purpose is to display some value in text box 2 based on the value of text box 1.
plz suggest how to achieve this.

thanks and regards

madhu
 
Did you perhaps copy and paste that code without actually registering the event handler? Select your TextBox in the designer, open the Properties window, click the Events button and look for that event. Is that method selected as the event handler? If not, select it from the drop-down. You should generally create your event handlers by double-clicking an event there. If you need to copy and paste, do that for the method body only.
 

Latest posts

Back
Top Bottom