Forum > Suggestions

I like TLabelledEdit, any chance of a TLabelledComboBox?

(1/3) > >>


I like TLabelledEdit quite a lot. It's handy to have the label and the edit box together. Which makes me think, why not a TLabelledComboBox?



Being a heavy user of the anchor editor I strongly advise against the TLabelledEdit because it does not cooperate with the anchor editor nor with autosizing:

Put a TLabelledEdit on the form, open the anchor editor and set the top anchor of the LabelledEdit to the form --> the label will disappear (it will have move out of the form).

Or put a TLabelledEdit into a TPanel and set the panel's AutoSize to true --> the panel will shrink to zero height. On the other hand, when there is a simple TEdit inside the Panel, the autosize adjusts the size of panel to match that of the edit perfectly. And when there is also a TLabel inside the panel which you anchored to the TEdit, the autosized panel will enclose both label and edit.

Good to know. I commonly anchor TLabels to TEdits and TComboBoxes, and never tried TLabelledEdits.

Delphi has the same problem with this control.
It should have been designed as a compound control, like we have done with TEditButton etc.



--- Quote from: Bart on June 02, 2021, 10:13:05 pm ---Delphi has the same problem with this control.

--- End quote ---
I checked both Delphi 7 and Delphi XE 10.3. Since Delphi does not have an anchor editor I cannot check its behaviour there. But when I put it into an auto-sized panel the size is correct, so that in encloses both label and edit - unlike Lazarus.


[0] Message Index

[#] Next page

Go to full version