Board index » delphi » Text justification?

Text justification?

Is it possible to get text in an editbox justified to the right?

If so, how?

Best regards

Peter Vrist
peter.vr...@mail.dk

 

Re:Text justification?


"Peter Vrist" <peter.vr...@mail.dk> skrev i melding
news:8r06gt$cat$1@news.inet.tele.dk...

Quote
> Is it possible to get text in an editbox justified to the right?

Yes, an easy way is to create a TEdit descendant that overrides the
CreateParams method:

procedure TMyEdit.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  if FRightAligned then
    Params.Style := Params.Style or ES_RIGHT;
end;

...where the boolean variable FRightAligned decides whether or not it
should be right-aligned.

--
Bjoerge Saether
Consultant / Developer
Asker, Norway
bsaether.removet...@online.no (remove the obvious)

Other Threads