|
unit SunEdit;
interface
uses
SysUtils, Classes, Controls, StdCtrls, Mask, Windows, Graphics, Messages, RzEdit;
type
// TSunEdit = class(TRzEdit)
TSunEdit = class(TEdit)
private
{ Private declarations }
protected
{ Protected declarations }
procedure KeyDown(var Key: Word; Shift: TShiftState);override;
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('SunComponent', [TSunEdit]);
end;
constructor TSunEdit.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
// self.FrameVisible:=true;
end;
procedure TSunEdit.KeyDown( var Key: Word; Shift: TShiftState);
begin
inherited;
IF ((KEY=Windows.VK_DOWN) or (KEY=Windows.VK_RETURN)) THEN
begin
perform(WM_NEXTDLGCTL,0,0);//移动到下一控件
self.Caption:=inttostr(ord(key));
end;
{
else
IF (KEY=Windows.VK_up) THEN
perform(WM_NEXTDLGCTL,1,0); //移动到上一控件
}
end;
end. |
|