procedure tspeedButtonAlign.Paint;
var
ARect:TRect;
begin
inherited;
if FAlignment= taLeftJustify then
begin
ARect:=Rect(0, 4, Width, Height);
DrawText(canvas.Handle, PChar(Caption), Length(Caption), ARect,
DT_LEFT or DT_VCENTER or DT_SINGLELINE);
end
else if FAlignment= taRightJustify then
begin
ARect:=Rect(0, 0, Width, Height);
DrawText(canvas.Handle, PChar(Caption), Length(Caption), ARect,
DT_RIGHT or DT_VCENTER or DT_SINGLELINE);
end
else if FAlignment= taCenter then
begin
ARect:=Rect(0, 0, Width-4, Height);
DrawText(canvas.Handle, PChar(Caption), Length(Caption), ARect,
DT_CENTER or DT_VCENTER or DT_SINGLELINE) ;
end;
end;