Reputation: 409
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
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
Reputation: 905
Set the TabIndex
of the controls you wish to navigate through. For the others, set TabStop
to false.
Upvotes: 3