首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

按回车键,焦点跳转至上一个控件

2012-07-08 
按回车键,焦点跳转至下一个控件? if? (Key 13) or (ActiveControl nil) or (ActiveControl.ClassName

按回车键,焦点跳转至下一个控件

? if? (Key <> 13) or (ActiveControl = nil) or (ActiveControl.ClassName = 'TMemo') then
??? Exit;
? if ActiveControl.ClassName <> 'TDBGrid' then
??? Perform(WM_Nextdlgctl,0,0);

? if ActiveControl.ClassName = 'TDBGrid' then
? begin
??? with TDBGrid(ActiveControl) do
??? begin
????? if (DataSource = nil) or (DataSource.State in [dsInactive, dsOpening]) then
??????? Exit;
????? if SelectedIndex = Columns.Count -1 then
????? begin
??????? DataSource.DataSet.Next;
??????? SelectedIndex := 0;
????? end else
??????? SelectedIndex :=SelectedIndex +1;
??? end;
? end;

按回车键,焦点跳转至下一个控件

?

热点排行