Right-aligned edit/dbedit

Makes only selected controls right-aligned

TEdit=class(StdCtrls.TEdit)
protected
procedure CreateParams(var Params:TCreateParams); override;
end;

procedure TEdit.CreateParams(var Params: TCreateParams);
begin
inherited;
if (FindString(Name, ['ID_Count', 'idQuickPay', 'ID_PartPay', 'ID_Total']) >=0)
or (Parent.Name = 'fCashup')
then
Params.Style:=Params.Style or ES_RIGHT;
end;

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>