Set FocusControl

Previous pageReturn to chapter overviewNext page


This tool enables you to quickly set the FocusControl property of labels on your VCL forms.  There are two ways to use this tool:


You can multi-select a TLabel and the associated TWinControl descendant (in either order) and execute this tool.  The FocusControl property of the label will be set to the TWinControl descendant.
You can multi-select any number of TWinControls and the tool will try and guess what TLabel to associate with each control.  It looks both above and to the left of the control a certain distance and tries to find the closest label.  It won't associate labels with controls where TabStop is False, or with any TButtonControl descendants.  Each label and control pair must have the same parent component.  Labels that already have an assigned FocusControl are not changed unless you hold down the Shift key while activating the tool.  If you want to locate a label for all TWinControls on the form at once, you can either use Edit, Select All or, equivalently, select the form itself to have the tool operate on the whole form.


After the FocusControl assignment process completes, any labels assigned a FocusControl will be selected in the designer, so you can see exactly which labels were modified.