SelectNext(ActiveControl, False, True);
解决方案 »
- 通过取sql server中文数据,然后用web打开出现乱码,如何解决啊,急!!!!
- 怎么把粘贴进ACCESS的OLE字段里的WORD文档读出来,并保存成文件?
- 请教一个函数问题!
- 简单的数据库的问题,还望指教!
- i/o error 183如何解决
- 请各位朋友帮忙解决一下问题: 使用APRO控件能否做到,在接收传真之前,播放一段语音提示?
- 有关VeCAD_DLL-OCX_v6.1.0-DIGERATI控件在delphi中打开.dwg文件的问题?
- 关于update table的当前记录的某个字段的问题,急!!!
- 在win98下安装Delphi6时的问题,急!!
- 请问大家开发是采用什么 方式?是否有采用主程序+DLL的?
- 各位各位,帮忙进来看看这个线程的问题!!!!!!!!!!!!!!!!!!!!!
- 这段代码为什么会出错?
Perform(WM_NEXTDLGCTL, 0, 0)
//在‘DBGrid’中‘空格’移到下一列**********************************************
//在‘Form’中‘回车’、‘下箭头’进入下一个控制********************************
//在‘Form’中‘上箭头’进入上一个控制******************************************
//==============================================================================
procedure WindowKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
//============================================================================
//1.空格键:在‘DBGrid’中移到下一列*******************************************
//============================================================================
if (Key=VK_SPACE) and ((Sender as TForm).ActiveControl is TDBGrid) then
with TDBGrid((Sender as TForm).ActiveControl) do
if SelectedIndex<(FieldCount-1)
then SelectedIndex := SelectedIndex + 1//increment the field
else begin
SelectedIndex := 0;
if not TDBGrid((Sender as TForm).ActiveControl).DataSource.DataSet.Eof
then TDBGrid((Sender as TForm).ActiveControl).DataSource.DataSet.Next
else TDBGrid((Sender as TForm).ActiveControl).DataSource.DataSet.First;
end;
//============================================================================
//2.回车键:在‘Form’中进入下一个控制*****************************************
//============================================================================
if Key=VK_RETURN then
if not ((Sender as TForm).ActiveControl is TCustomGrid) then//if not on a TDBGrid
begin
Key := Word(0);//eat enter key
(Sender as TForm).Perform(WM_NEXTDLGCTL, 0, 0);//move to next control
end;
//============================================================================
//3.下箭头:在‘Form’中进入下一个控制*****************************************
//============================================================================
if Key=VK_DOWN then
if not ((Sender as TForm).ActiveControl is TDBLookupControl)
and not ((Sender as TForm).ActiveControl is TCustomGrid)
and not ((Sender as TForm).ActiveControl is TCustomListBox)
and not ((Sender as TForm).ActiveControl is TCustomComboBox)
and not ((Sender as TForm).ActiveControl is TCustomTreeView)
then begin
Key := Word(0);//eat down key
(Sender as TForm).Perform(WM_NEXTDLGCTL, 0, 0);//move to next control
end;
//============================================================================
//4.上箭头:在‘Form’中进入上一个控制*****************************************
//============================================================================
if Key=VK_UP then
if not ((Sender as TForm).ActiveControl is TDBLookupControl)
and not ((Sender as TForm).ActiveControl is TCustomGrid)
and not ((Sender as TForm).ActiveControl is TCustomListBox)
and not ((Sender as TForm).ActiveControl is TCustomComboBox)
and not ((Sender as TForm).ActiveControl is TCustomTreeView)
then begin
Key := Word(0);//eat up key
(Sender as TForm).Perform(WM_NEXTDLGCTL, -1, 0);//move to back control
end;
end;
if Key = #13 then
Perform(WM_NEXTDLGCTL, 0, 0)
if Key = #13 then
Perform(WM_NEXTDLGCTL, 0, 0)
begin
Key := #0; { Eat the enter key }
Perform(WM_NEXTDLGCTL, 0, 0);
end;