bhlang
asked on
Manipulate TabControl from code
I have a TabControl on a form with three tabs.
Each TabPage has a set of controls on it.
Here's what I want to know how to do with code:
1. When the form is loaded, set the Focus to the first TextBox where ReadOnly = False (some TextBoxes have ReadOnly = True)
2. When the user gets to the last TextBox on a TabPage and tabs out of that TextBox, Switch to the Next TabPage.
From the answers to these, I should be able to extrapolate how to do the reverse (ie. switch to the Previous TabPage and set Focus to the Last TextBox on a TabPage).
Each TabPage has a set of controls on it.
Here's what I want to know how to do with code:
1. When the form is loaded, set the Focus to the first TextBox where ReadOnly = False (some TextBoxes have ReadOnly = True)
2. When the user gets to the last TextBox on a TabPage and tabs out of that TextBox, Switch to the Next TabPage.
From the answers to these, I should be able to extrapolate how to do the reverse (ie. switch to the Previous TabPage and set Focus to the Last TextBox on a TabPage).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
So when I saw your first suggestion, I though that it would fail. But I tried it anyway, and whaddya know - it worked! Now the form loads with the field I want the focus in having the focus.
And as for the second part, that's exactly what I was looking for.
Thank you very much.