I'm a bit new to windows forms so I apologize if there is a simple solution, but I can't find anything on google. If I drag an item, for instance a textbox, onto the form, and double click it, the textbox_TextChanged function will be created for me. This works as expected. However, if I attempted to add a new function such as textbox_Click, it will never be called. In another project, I attempted to add a textbox_Validating function and it isn't being called either (I made sure validating was on in the properties).
Does anyone know why only the TextChanged function is being called?
Here is what is working:
private void textBox2_TextChanged(object sender, EventArgs e)
{
textBox2.BackColor = activeColor;
}
Here is what isn't working:
private void textBox2_Click(object sender, EventArgs e)
{
textBox2.BackColor = activeColor;
}
I've set a breakpoint in the textBox2_Click method and it is never being called. I've looked around the web and tried other methods such as _LeftMouseClick and _LeftMouseButtonDown but they aren't working ether.
This also isn't working:
protected void tbNewPassword_Validating(object sender, CancelEventArgs e)
{
if (tbNewPassword.Text.Length < 6)
epErrorProvider.SetError(tbNewPassword, "Your password must be 6 characters or longer.");
}
As with the _Click method, I've set a breakpoint and it is never being called.