Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable a tab index on a control on a form?

Tags:

c#

tabindex

I have a form with 2 buttons and 2 labels.

I want to set button 1 = tabIndex = 0, button 2 = tabIndex = 1 and I do not want to set a tabIndex to the 2 labels, meaning that if the user presses tab, it'll go from button 1 to button 2.

How would I go about doing this?

like image 694
JJ. Avatar asked Sep 04 '12 21:09

JJ.


People also ask

How do I get rid of tab index?

Solution with the tabindex attribute To prevent tab indexing on specific elements, you can use tabindex="-1". If the value is negative, the user agent will set the tabindex focus flag of the element, but the element should not be reachable with sequential focus navigation.

What is the use of tab Index property of the control?

The following example uses the TabIndex property to display and set the tab order for individual controls. You can press Tab to reach the next control in the tab order and to display the TabIndex of that control. You can also click on a control to display its TabIndex.

What happens when you set the Tab Stop property to No for a control?

For example, you can set the TabStop property of a command button to No to prevent users from selecting the button by pressing Tab. However, they can still click the command button to choose it.


1 Answers

Just set the TabStop property of the Labels to false and the TabIndex property of the Buttons to whatever you want. You can do it right in the Properties window of the designer.

like image 116
itsme86 Avatar answered Oct 15 '22 02:10

itsme86