只要重载一下createparams就可以了,very easy
unit rightedit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
Trightedit = class(Tcustomedit)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
procedure CreateParams(var Params: TCreateParams); override;
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('hubdog lib', [Trightedit]);
end;
procedure TRightEdit.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
Params.ExStyle:=Params.ExStyle or WS_EX_RIGHT;
end;
end.