209k views
3 votes
What property of a form is used to specify what happens when you press the Tab key and the focus is in the last control on a bound form?

User Donnet
by
7.6k points

1 Answer

3 votes

Final answer:

The 'Cycle' property of a form is used to specify what happens when the Tab key is pressed and the focus is on the last control of a bound form.

Step-by-step explanation:

The property used to specify what happens when you press the Tab key and the focus is on the last control of a bound form is the Cycle property. This property determines the behavior of the focus when the end of the tab order is reached on a form.

The Cycle property can generally be set to one of several options, such as 'All Records', which moves the focus to the first control in the next record, 'Current Record', which moves the focus to the first control in the current record, or 'Current Page', which moves the focus to the first control at the top of the current page if the form is divided into multiple pages.

When the KeyPreview property is set to True, the form's KeyPress, KeyDown, and KeyUp events are triggered before any control-level events. This allows you to handle the Tab key press event at the form level and define the desired behavior.

For example, you can write code in the form's KeyDown event to check if the Tab key was pressed and if the focus is in the last control. If these conditions are met, you can programmatically set the focus to the first control, creating a cyclic navigation pattern.

User Atef
by
7.8k points