Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi: How to adjust text vertical position of a TEdit

The text in a TEdit (or TCombo, TButtonedEdit) is always aligned to top. I have not found any property to change the alignment. Usually it is not a problem, unless I want to set a larger height.

I googled a little. There are solutions to adjust the left and the right margins by sending a Windows message. But I have no idea, how to adjust the vertical alignment.

I do not want to use a larger font. Any ideas?

like image 949
stanleyxu2005 Avatar asked Oct 21 '22 06:10

stanleyxu2005


1 Answers

If there was such an option it would be applied by way of a style. The EDIT control styles list contains no such style and so the conclusion is that the underlying control does not offer this functionality.

You'll have to either make a new control, or take over the painting yourself. Neither is particularly appealing.

like image 190
David Heffernan Avatar answered Oct 23 '22 04:10

David Heffernan