procedure Tform1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if not (key in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', #8, #13]) then key := char(0); //key:=char(' ');//#8是回退键,#13是回车键 if key = #13 then begin selectnext(activecontrol, true, true);//跳转到下一个控件 end; end;
begin
if not (key in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', #8, #13]) then
key := char(0); //key:=char(' ');//#8是回退键,#13是回车键
if key = #13 then
begin
selectnext(activecontrol, true, true);//跳转到下一个控件
end;
end;