sniff_bits
sniff_bits

Reputation: 409

Disable some of the TabIndex values on Form Controls?

I have a Windows Form with 27 controls, but I need the tab key to cycle between only four of these controls. Every time the tab key is pressed, it should only move the focus between these 4 controls.

How do I do this?

Upvotes: 2

Views: 1031

Answers (2)

user189198
user189198

Reputation:

This article describes how to set the tab index on Windows Forms controls.

http://msdn.microsoft.com/en-us/library/bd16a8cw(v=vs.90).aspx

According to that article, setting the TabStop property to false, on the controls that you want to be ignored by TAB, should achieve your objective.

For the 4 controls that you do want to be affected by pressing TAB, use the TaxbIndex property to set the values from 0 to 3.

Upvotes: 1

Zzyrk
Zzyrk

Reputation: 905

Set the TabIndex of the controls you wish to navigate through. For the others, set TabStop to false.

Upvotes: 3

Related Questions