Very simple:
private void textBox1_GotFocus(object sender, EventArgs e)
{
this.textBox1.Text = "AAA";
}
This does not appear to be doing anything. my textBox is called textBox1. No error, but it is not doing what I want.
Any idea?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In your form’s constructor, make sure you have this:
The GotFocus event is hidden from the designer, so you have to do it yourself.
As Hans pointed out, GotFocus is basically replaced by the Enter event, and you should use that instead: