请教: Delphi中通常使用Tab键移动光标,那么如何使用回车键来代替? 多谢!
解决方案 »
- 急求Automation例子
- 关于有模式对话框的问题?高手请进来看看!
- 怎么用ClientSocket list FTP服务器下的目录?
- 请问如何在Form中显示gif图片?
- 道别!
- 如何对TShapeType、TColor进行与string或integer的双向转换?
- 将paradox数据库设了密码后,在程序内写密码,不要让用户输入密码,也就是我不想让用户不运行程序就能打开数据库。 在BDE及ADO中如何设置
- DELPHI中使用SQL好象十分困难。有无什么地方介绍其语法规范啊?
- 高分求解,Cxgrid获取鼠标指针下的单元格
- CSDN没有高手, 大家都去大富翁吧
- 关于如何设置TTS系列控件朗读中文的问题?
- 关于打印时出现纸张跳行现象...
private
Procedure CMDialogKey(Var Message :TCMDialogKey); Message CM_DialogKey;Procedure TForm.CMDialogKey(Var Message :TCMDialogKey);
begin
if (GetParentForm(Self).ActiveControl is TButtonControl) then
inherited
else
if (Message.CharCode = VK_RETURN) then
begin
GetParentForm(Self).Perform(CM_DialogKey,VK_TAB,0);
Message.Result := 1;
end else
inherited;
end;
procedure Tform.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
Edit2.SetFocus;
end;
begin
if Key = #13 then Perform(WM_NEXTDLGCTL, 0, 0);
end;
begin
if Key = #13 then
Edit2.SetFocus;
end;
Shift: TShiftState);
begin
if (key=VK_Down) or (key=13) then
SelectNext(ActiveControl,True,True);
if key=VK_Up then
SelectNext(ActiveControl,False,True);
end;建立这个Tab过程,然后把需要执行回车功能的控件写上Tab这个过程即可,如: Edit1.OnKeyDown:=Tab;