|
-
September 29th, 2004, 06:55 PM
#1
Tab order in a GroupBox
hello everyone.
Ok, I have my app finished, except for one annoying thing... I cant get the tab order to work in the group boxes.
The app is set up as follows:
two lines for User input each line contans 3 text boxes for entering hours, minutes and seconds and one group box. The GroupBox contains 2 radio buttons, one for am and one for pm.
so the problem is tab order and focus. First, how do you assign focus to a radio button? I tried Me.AmButton.Focus(), but that doesnt work.
Next, how do you successfully assign tab order. I set the order as follows:
1 hours1
2 minutes1
3 seconds1
4 groupbox1
4.0 groupbox1.ambutton
4.1 groupbox1.pmbutton
5 hours2
6 minutes2
7 seconds2
8 groupbox2
8.0 groupbox2.ambutton
8.1 groupbox2.pmbutton
The problem is, when I build the app and run it (F5) I can tab through the text boxes, but the group boxes and radio buttons are skipped over each time.
I have looked around the net but have not found anything that I didnt already know about doing this... and I have checked all the tabs, and the order is correct.
any ideas?
Jeff
-
September 29th, 2004, 11:51 PM
#2
Re: Tab order in a GroupBox
You are going to want to think of the groupboxes tab index and the object tab indexes as two different levels.
The Groupboxes are higher priority than the objects.
You want to set the tab index of your first groupbox to 0.
Then set your next groupbox to 1 and so on.
Then in your first groupbox you want to set the tab index of the objects.
Set your first one to 0 and then number them accordingly.
Then in your second groupbox set your objects tab index like you did the first groupbox starting with 0 and so on.
The way it will look at it is it will go to the first groupbox, go through all of its items, then go to the second groupbox and go through its objects and so on.
Good Luck.
-
September 30th, 2004, 08:18 AM
#3
Re: Tab order in a GroupBox
hrmmm... that makes sense, but the problem I am having is that for this app (which simply calculates time between two user entered times) the time entry boxes are NOT part of the group boxes that contain the am and pm radio buttons.
If I get the time tonight when I get hoem, I will take a screen shot or two of the window to show what it looks like...
But in an nutshell, it goes like this from left to right:
StartHoursTextBox StartMinutesTextBox StartSecondsTextBox Groupbox1(ambutton pmbutton)
EndHoursTextBox End MinutesTextBox StartSecondsTextBox Groupbox2(ambutton pmbutton)
CalculateButton ClearBoxesButton ExitButton
the tab order is correct for what this should do (i.e. the radio buttons come after the hours, minutes and seconds) but are you saying then that I should change the group box and radio buttons from being tabs 4, 4.0 and 4.1 (which is hwat VB.NET assigns them to something like 4, 5, 6 instead?
And that being the case, with radio buttons, in code, if I want to give focus to a radio button shouldnt Me.RadioButton.Focus() work??? Of course, I could be completely off base there...
Thanks for the help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|