Set focus to control on form when displayed

T

Tim

Hi,

How do I set the focus to a control (TextBox) on the form when it is
displayed. The text box is empty and I want the caret blinking in it.
It is not the first item in the tab order and I can't make it such.

So how do I do it? I thought this was relatively easy but I must be
having a mental block.

Tim
 
N

Nicholas Paldino [.NET/C# MVP]

Tim,

You can just call the Focus method on the control, and it will shift the
focus to that control.

Hope this helps.
 

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