I tried the code for setting focus on a textbox with FORM1_LOAD and ActiveControl. I received the following error:
(101): 'RatingsEngine.RatingMediaInstance' does not contain a definition for 'ActiveControl'
Can you please guide me on how to go about setting focus at form load in C#? Thanks in advance for your help.
There are two ways of doing this:
- In the Form.Load event handler, write: this.ActiveControl = txtInput;
- In the Form.Activate event handler, write: txtInput.Focus();
Dig Deeper on C# programming language
Related Q&A from Daniel Cazzulino
Here our experts address how to converti a VB Windows application to a VB .NET Web application. Continue Reading