Not sure if this will work, but it is worth a try.  Create a sub-class of
TButton and override the CreateParams method:

procedure TButtonNew .CreateParams(var Params: TCreateParams);
begin
  inherited;

  Params.Style := Params.Style or BS_LEFTTEXT;
end;

BS_LEFTTEXT is declared in the Windows unit.

----- Original Message -----
From: "Ross Levis" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Sunday, August 31, 2003 8:54 PM
Subject: Re: [DUG]: Button Caption


> >Ross Levis wrote:
> >>Is there an easy way to left justify a TButton caption
>
> Rohit Gupta wrote:
> > Its possible but will take you hours to find it.... look  at the VCL
> > code for TBitBtn and then try to copy the relevant bits into TButton.
> > Or start with TPanel and make your own button component.
>
> TPanel in D5 must not use standard Windows controls either.  It doesn't
show
> with the new rounded edges and colors etc.  Most of the D5 components do.
>
> I'm trying to follow the VCL code but I can't find where the caption is
> updated using the Windows API.  Buttons don't appear to have a canvas.
Can
> anyone point me in the right direction?  Or is it basically impossible.
>
> Regards,
> Ross.
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to