Gali Gali - 1 year ago 83
C# Question

how to put focus on TextBox when the form load?

I have in my C# program textBox

I need that when the program start, the focus will be on the textBox

I try this on Form_Load:


but it wont work

Answer Source

Set theActiveControl property of the form and you should be fine.

this.ActiveControl = yourtextboxname;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download