Posted by webmaster Guido
on April 18, 2001
In Reply to: Re: Re: Combobox posted by Peter Maes on April 05,
2001
: : : Is it possible to change the height of a combobox? : : : I want to change the height to 17 but it always jumps back to 21. : : Probably you have set the property IntegralHeight to True by accident. : : When IntegralHeight is True, the height of the box will be a multiple of the ItemHeight property, so that an item will never be partially shown. If IntegralHeight is False (the default value), the height can be set to any value, but the last item may not be fully displayed. : You don't have this property with a combobox. Only with a CustomListBox.
--------------------------------------------------
You're
right, you can not directly set the height of a Delphi combobox. It depends from ItemHeight,
which in turn depends from the font size. "Height" is in fact the height of the "edit" box
that is on top of the combobox.
If you set "Style" to csOwnerDrawFixed, you can change ItemHeight in runtime, thus directly changing "Height".
Some of the changes can only be seen when you change the "Style" back-and-forth, some
changes even can't be seen during "design time". In short, the combobox behaviour is not
very consistent and intuitive, you have to experiment with Font, ItemHeight and Style.
Find related articles
Search for: ComboBox
|