«« Site Rescued »»

While the site is still going to move from its current host, a new site will now take its place. More Info.

The new site may have less content, but the core will now remain. And it will now play nicely with phones! Keep an eye on the DelphiDabbler Blog for news.

» Help

How to centre text in a TEdit (alternative approach)

   

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

with Edit1 do
  SetWindowlong(
    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 »