Set the focus with multiple panels

  • Thread starter Thread starter Jenny R.
  • Start date Start date
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
 
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
 
Back
Top