极
极品铁观音
Unregistered / Unconfirmed
GUEST, unregistred user!
目的:敲键盘字母键时动作,字母作为变量用于操作.
搜索论坛上的case key of 等都没办法编译通过,因为key为关键字而出错.我的程序如下:
procedure TF_lyshd.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (key>=65) and (key<=91) then
begin
begin
with jc_dm.ADO_shd do
begin
close;
sql.clear;
sql.add('SELECT name,key_symbol FROM sys_parm a WHERE (a.key_symbol like key ) UNION ALL SELECT name,key_symbol FROM sys_parm b WHERE (b.key_symbol not like key)');
open;
dbgrideh1.DataSource.DataSet:=jc_dm.ADO_shd;
end;
end;
end;
end;
上面程序的key要用捕获到的字母键的变量代替.
搜索论坛上的case key of 等都没办法编译通过,因为key为关键字而出错.我的程序如下:
procedure TF_lyshd.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (key>=65) and (key<=91) then
begin
begin
with jc_dm.ADO_shd do
begin
close;
sql.clear;
sql.add('SELECT name,key_symbol FROM sys_parm a WHERE (a.key_symbol like key ) UNION ALL SELECT name,key_symbol FROM sys_parm b WHERE (b.key_symbol not like key)');
open;
dbgrideh1.DataSource.DataSet:=jc_dm.ADO_shd;
end;
end;
end;
end;
上面程序的key要用捕获到的字母键的变量代替.