Click here to Skip to main content
15,879,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, I have a problem with tab order of RadioButtons in winforms. I have a GroupBox, in that four Textboxes and Five RadioButtons and also Buttons . when pressing the tab , RadioButtons tab order don't work. How to do this. .


hi,

Main GroupBox tab order 0
label1 tab order 0.1
textbox1 tab order 0.2
label2 tab order 0.3
textbox2 tab order 0.4

Another GroupBox within the main GroupBox Tab Order 0.5
with groupbox i have RadioButtons Tab Order 0.5.0
RadioButtons Tab Order 0.5.1
RadioButtons Tab Order 0.5.2
RadioButtons Tab Order 0.5.3

in Main Group Box

label3 tab order 0.6
textbox3 tab order 0.7

and also few Buttons

Button1 Tab order 0.8
Button2 Tab order 0.9
Button3 Tab order 0.10


I set the some properties of radioButtons like TabStop =False

Please any one help me.
Posted
Updated 17-Oct-12 23:52pm
v4

In design mode, you can set it via the View Menu -> Tab Order, or via the toolbar button.
See here: http://msdn.microsoft.com/en-us/library/csz6b8x8.aspx[^] And note that radio buttons should be in a group box or similar, so their tab orders should be something like 5.1, 5.2, 5.3 and so on.
 
Share this answer
 
Comments
CH Guravaiah 18-Oct-12 5:12am    
I was set but it can be find only one Radiobutton next going to other controls.
OriginalGriff 18-Oct-12 5:19am    
Strange. It works for me.
When you pressed the TabOrder button, or selected it via the menu, did white-on-blue numbers appear on each control?
OriginalGriff 18-Oct-12 5:23am    
Ah. One moment - do you mean that TAB switches between controls, until it reaches the Radio buttons, when it move to the first, then skips all the other and moves to a textbox, or Button control, in spite of the TabOrder?
If so, then that is the normal behaviour - RadioButtons are thought of as a single item (hence they work as a group, with only one selected at any time). To move to other RadioButtons in the same group, you use the up and down buttons, not TAB
CH Guravaiah 18-Oct-12 5:34am    
Hi please check the my question once. i was specified tab order of my controls.
CH Guravaiah 18-Oct-12 5:45am    
please give me one example of tab order.
To set the tab order of a control

On the View menu, click Tab Order.

This activates the tab-order selection mode on the form. A number (representing the TabIndex property) appears in the upper-left corner of each control.

Click the controls sequentially to establish the tab order you want.

Note
A control's place within the tab order can be set to any value greater than or equal to 0. When duplicates occur, the z-order of the two controls is evaluated and the control on top is tabbed to first. (The z-order is the visual layering of controls on a form along the form's z-axis [depth]. The z-order determines which controls are in front of other controls.) For more information on z-order, see Layering Objects on Windows Forms.
When you have finished, click Tab Order on the View menu again to leave tab order mode.

Note
Controls that cannot get the focus, as well as disabled and invisible controls, do not have a TabIndex property and are not included in the tab order. As a user presses the TAB key, these controls are skipped.
Alternatively, tab order can be set in the Properties window using the TabIndex property. The TabIndex property of a control determines where it is positioned in the tab order. By default, the first control drawn has a TabIndex value of 0, the second has a TabIndex of 1, and so on.

Additionally, by default, a GroupBox control has its own TabIndex value, which is a whole number. A GroupBox control itself cannot have focus at run time. Thus, each control within a GroupBox has its own decimal TabIndex value, beginning with .0. Naturally, as the TabIndex of a GroupBox control is incremented, the controls within it will be incremented accordingly. If you changed a TabIndex value from 5 to 6, the TabIndex value of the first control in its group automatically changes to 6.0, and so on.

Finally, any control of the many on your form can be skipped in the tab order. Usually, pressing TAB successively at run time selects each control in the tab order. By turning off the TabStop property, you can make a control be passed over in the tab order of the form.




reference:


http://msdn.microsoft.com/en-us/library/bd16a8cw(v=vs.80).aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900