TDBGrid中用Enter仿真Tab键盘
2006-02-04 13:28:00 来源:WEB开发网核心提示:PRocedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);begin if Key = #13 then //如果是一个Enter键盘 begin if not (ActiveControl is TDBGrid) then //如果当前的控件不
PRocedure TForm1.FormKeyPress(Sender: TObject; var Key:
Char);
begin
if Key = #13 then //如果是一个Enter键盘
begin
if not (ActiveControl is TDBGrid) then //如果当前的控件不是TDBGrid
begin
Key := #0;
Perform(WM_NEXTDLGCTL, 0, 0); { move to next control }
end
else if (ActiveControl is TDBGrid) then //在TDBGrid中
begin
with TDBGrid(ActiveControl) do
begin
if selectedindex < (fieldcount -1) then //如果不是最后一个字段
selectedindex := selectedindex +1
else
selectedindex := 0;
end;
end;
end;
end;
Char);
begin
if Key = #13 then //如果是一个Enter键盘
begin
if not (ActiveControl is TDBGrid) then //如果当前的控件不是TDBGrid
begin
Key := #0;
Perform(WM_NEXTDLGCTL, 0, 0); { move to next control }
end
else if (ActiveControl is TDBGrid) then //在TDBGrid中
begin
with TDBGrid(ActiveControl) do
begin
if selectedindex < (fieldcount -1) then //如果不是最后一个字段
selectedindex := selectedindex +1
else
selectedindex := 0;
end;
end;
end;
end;
- ››Enterprise-Wide Unique 标识符
- ››TDBGrid控件中对多个记录的处理
- ››Enterprise JavaBeans组件慨述之一
- ››Enterprise JavaBeans 组件慨述之三
- ››EnterpriseJavaBean的结构优点的探讨
- ››Enterprise JavaBeans 基础知识简介
- ››Enterprise JavaBeans导论5
- ››Enterprise JavaBeans导论6
- ››Enterprise JavaBeans导论2
- ››Enterprise JavaBeans导论3
- ››Enterprise JavaBeans导论1
- ››Enterprise JavaBeans组件慨述之二
更多精彩
赞助商链接