有什么可以判断你的最后一个编辑框编辑结束了呢? 假设是用回车的话,就在编辑框里的keypress中判断 if key=$13 then Button1.setfocus;
如果密码规定为6位的话: procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Length(Edit1.Text)=6 then Button1.SetFocus; end; 如果想按回车到BUTTON的话用楼上的方法!
假设是用回车的话,就在编辑框里的keypress中判断 if key=$13 then Button1.setfocus;
procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Length(Edit1.Text)=6 then
Button1.SetFocus;
end;
如果想按回车到BUTTON的话用楼上的方法!
或者定义taborder,用tab切换焦点
begin
Selectnext(activecontrol,true,true);
Key:=#0;
end;
keypress事件里,当key=#13时,setfocus一下,很好...
回车?在keypress事件里,当key=#13时