Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

position cursor to specific text box

Status
Not open for further replies.

kimprogrammer

Programmer
Sep 15, 2008
160
CA
Hello
I created controls at design time and run time.
My first 4 are my keys and then I have some text box created. The keys I gave the tabindex on to 4 and the text boxes is the designer 131,etc and in the code I created texboxes with indexes of 5 to 126.

But when i debug - after I enter the last of the keys my cursor positions itself at the box that is 131 and not the on created at runtime that was set to 5.

What do I code for the cursor to be postion at a specific textbox?


Thanks for the help
Kim
 

TextBox1.Focus()



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
I'm not sure, but off the top of my head, the tab index is relative to the control's container. Do you have controls created at runtime wrapped in a panel or anything? If so, have you set the container control's tab index?

Also, are you seeing any performance issues with 130+ controls on a form?
 
Yes I have 14 panels with 9 controls(for data entry - there are more that are text fields in each - and I hadn't given a tabindex to the panels. So that is probably the issue.

As far a performance issues - this being my first project and it it a simple data entry screen I wouldn't really know for sure. But it appears to load right away and it keeps up to me doing the data entry.

Thanks for the help
Kim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top