Focus on form load

E

Etienne Boucher

This is probably overly simple to fix, but I can't seem to find how. I have
a form with a TabControl, and when the form loads, it puts the focus on the
first tab by default. I want to put the focus on a text control ON the first
tab, but I can't find where to do that. If I give the focus to the control
in Form.Load, it doesn't work. How can I do this?

Thanks in advance,
Etienne Boucher
 
T

Tim Wilson

Set the TextBox as the ActiveControl for the Form.

[C#]
this.ActiveControl = this.textBox1;
 
E

Etienne Boucher

That's not so clean since my textbox is on a custom control, but it works.
Thanks!

Etienne Boucher
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top