怎样用回车键代替TAB键,实现焦点在控件间的移动。
以前见过,没用就忘了。望各位大侠,小虾多多指教。
以前见过,没用就忘了。望各位大侠,小虾多多指教。
解决方案 »
- delphi 如何进行文字或图片的打印预览
- 高难的组件问题呦!
- TstringList里面的内容按降序排列?
- 急!!!!!!!!!!!!!!!!怎么样实现在PANEL上实现透明文字
- ====Delphi 5.0 企业版打不上pack1,救救我吧====
- delphi7怎么注册?
- 替换开始菜单的例子
- 在音量不变的情况下,如何编程实现静音?
- strtodatetime(ontime)<>StrToDateTime('1900-01-01')為什麼出錯??
- 关于TADOConnection 控件的使用
- delphi高手请进来,我下载的Inforpower 4000 怎么装不上,谁有Inforpower for delphi7,在线等待!!!
- 动态生成一个对象后,就如个空壳,请教如何动态为其写事件代码?
Begin
if key=#13 then { 判断是按执行键}
if not (ActiveControl is TDbgrid) Then
Begin { 不是在TDbgrid控件内}
key:=#0;
perform(WM_NEXTDLGCTL,0,0);{移动到下一个控件}
end else
if (ActiveControl is TDbgrid) Then{是在 TDbgrid 控件内}
begin
With TDbgrid(ActiveControl) Do
if Selectedindex<(FieldCount-1) then
Selectedindex:=Selectedindex+1{ 移动到下一字段}
else Selectedindex:=0;
end;
End;
if Key = #13 then
if ActiveControl = DBGrid1 then begin
TDBGrid(ActiveControl).SelectedIndex := TDBGrid(ActiveControl).SelectedIndex + 1;
Key := #0;
其它则在ONKEYPRESS事件中写入另一控件.setfocus