Forum > Suggestions

I like TLabelledEdit, any chance of a TLabelledComboBox?

<< < (3/3)

Exception:
I guess a more flexible way of doing things would be if you can somehow group different components together, so when you move one at design time, the other follows. I know you can do this with panels, but I find lots of panels a bit messy.

I notice, @wp, you mention "which you anchored to the TEdit" which maybe sounds like a method of doing that, but I couldn't find anything on the right click menu to link two visual components together.

Thanks.

wp:

--- Quote from: Exception on July 02, 2021, 02:05:06 pm ---I notice, @wp, you mention "which you anchored to the TEdit" which maybe sounds like a method of doing that, but I couldn't find anything on the right click menu to link two visual components together.

--- End quote ---
I mean this:

* Place a TPanel on the form, delete the panel's Caption.
* Add a TLabel and a TEdit to the panel
* Right-click on the Edit and select "Anchor Editor" --> The window with the Anchor Editor appears.
* In the combobox of the "Left anchoring" group of the Anchor Edit, select the label; in the combobox of the "Top anchoring" group, select the label, as well, but then click in the lower button in the vertical 3-button-group at the right - this puts the Edit below the label. (When you now drag the label somewhere the Edit always follows. If you try to drag the edit instead this will not work because the way we did the anchoring the edit position derives from the label position - of couse you can also link the controls in the opposite order by slightly changing the steps - try this on your own...)
* Return to the form editor, select the panel. Go to the Object Inspector and set the panel's AutoSize to true --> Now the label and edit are moved into the upper left corner of the panel, but the anchoring makes the edit stay below the edit, and the size of the panel shrinks to tightly surround the two controls.

Navigation

[0] Message Index

[*] Previous page

Go to full version