unit MIEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TMIEdit = class(Tedit)
private
procedure keypress(var key:char);override;
{ Private declarations }
protected
{ Protected declarations }
public
constructor create(owner:tcomponent);override;
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure tMIedit.keypress(var key:char);
begin
if not (key in['0'..'9',#8,#13]) then key:=#0;
inherited;
end;
constructor Tmiedit.create(owner:tcomponent);
begin
inherited ;
end;
procedure Register;
begin
RegisterComponents('michael', [TMIEdit]);
end;
end.
将就看一看