.Focus Question...

T

Tony

I have two forms in my windows application, one have two textboxes, one have
a group box and two textboxes inside the group box, when i do .Focus() in
the first form, it works fine, however, when i do it on the second form, the
textboxes just couldn't get the focus... seems that control inside group box
can't get the focus via .Focus()
How can i get around this?
Thanks
Tony
 
K

kate-luu

Can you try this:

at from two:

this.Controls[2].Focus();

"this" is mean for form 2
index number "2" is assum your text box inside this form was have array
index of two.

hope this help

Kate
 

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