Notice Of Closure

Please note that this website is due to close down on 15th June 2020.

In the interim I will try to move as much content as possible over to my GitHub account. Thanks to everyone who has supported the site over the years.

» Help

How to centre text in a TEdit (alternative approach)


To centre text in an edit control named Edit1, do this:

with Edit1 do
    Handle, GWL_STYLE, GetWindowlong(Handle,GWL_STYLE)or ES_CENTER

Also see Tip #85 for a different approach.

Author: JMS
Contributor: JMS
Added: 2010-04-08
Last updated: 2010-04-08

« Return to contents »