问个简单的问题??? 假如我的窗体上有N个文本框,我录入第一个文本框后回车,怎么控制跳到第二个文本框,。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 假如有Edit1和Edit2:procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin if Key=#13 then Edit2.SetFocus;end; 大哥,我觉得你这种方法写代码好象很累呀,我的一个窗体N个文本框,能不能根据TAB的顺序自动获取焦点,代码省了很多,只是我不会写,谁会的话告诉我呀 在keypress事件里if key = #13 thenbegin key := #0; SelectNext(ActiveControl,true,true);end;//当然前提你要设置好TAP. 在form.onshortcut if msg.CharCode = 13 then perform(WM_NEXTDLGCTL, 0, 0); 提前按顺序设置好你的edit的taborder 查一查共享事件处理函数的应用.(sender :Tobject) 1.设置好Tab.2.窗体的属性:KeyPreview设置为True.3.窗体的OnKeyPress事件中写:if Key=#13 then SelectNext(ActiveControl,True,True); 其实用1楼的那个就可以了,要是觉得烦可用 procedure SetFocusNext(var Key:char; Edit1: TEdit);begin if Key=#13 then Edit1.SetFocus;end;再调用,呵呵 inno setup的问题 一个有意思的问题,和webbrowser有关的,大家来动动脑子了啊 你在沉默吗?程序写久了,人就沉默了!! 小问题:) Delphi的IDE 怎样转换数据库文件的路径。 如何动态的备份和还原注册表 碰到难题了,请大家帮忙! 问一个StringGride的问题? 如何强行关闭一应用程序 在用DCOM做三层,客户端连接服务器时出现"拒绝访问"现象! FROM 附近语法错误
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then
Edit2.SetFocus;
end;
if key = #13 then
begin
key := #0;
SelectNext(ActiveControl,true,true);
end;//当然前提你要设置好TAP.
if msg.CharCode = 13 then
perform(WM_NEXTDLGCTL, 0, 0);
SelectNext(ActiveControl,True,True);
begin
if Key=#13 then
Edit1.SetFocus;
end;
再调用,呵呵