Set the focus with multiple panels

J

Jenny R.

Hi,

I have a win form wich is composed of multiple panels (all
visible). In one of the panel, I have a UserControl that I
have made.

When the form gets loaded, I want to have the focus in a
Textbox inside the UserControl (which is inside a panel).
I used:

MyForm.MyUserControl.myTxtBox.Focus()

but it doesn't work: the boolean value returned by this
function is false!

Any idea of what I need to do?

thanks,

Jenny
 
T

T Waldren

In my form, I have an Load event which would then include something like
this:

textboxtofocuson.Focus();

that should then give the focus to that specific text box (at least it does
in C#)

T. Waldren
 

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