易截截图软件、单文件、免安装、纯绿色、仅160KB

delphi上下键切换焦点

请教各位大侠:
Delphi中用上下键或回车键切换输入框:
在edit1的OnkeyPress事件里:
  if (key in[#13,#38]) then
  begin
  edit2.SetFocus ;
  end;
为什么按回车键可以,而上键不可以?

=!!!!

Delphi(Pascal) code:

procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key in [38,40] then
Edit2.SetFocus;
end;



Delphi(Pascal) code:

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then
self.Edit2.SetFocus;
end;

procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key=40 then
self.Edit2.SetFocus;
end;




用FormKeyDown可以,设Form的KeyPreview为true
我一直用的程序:
上/下键进入上/下控件,回车进入下一个,ESC关闭Form
Delphi(Pascal) code:

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case key of
vk_down,vk_up:if activecontrol.tag=0 then
selectnext(activecontrol,key=vk_down,true);
13: if activecont


相关问答:

Python中的Unicode在Delphi如何还原成Gb2312?

已知Python 中:
s = unicode("测试", "gb2312")
s = u'\u6d4b\u8bd5'
print s
测试

在Delphi里面如何将\u6d4b\u8bd5这样的还原成Gb2312的汉字呢?
找到个方法
......

这个SQL语句有什么问题? - Delphi / 非技术区

select * from shuju.DB where 开盘价-收盘价<=0.02
开盘价 与收盘价 是数据库里的字段
select * from aTableName where ((开盘价-收盘价) <=0.02 )

开盘价比收盘价低两分以下的情况

Mark!!!!!!

se ......

DELPHI中调用带有日期型参数的存储过程

SQL code:
CREATE PROCEDURE 合计
@date1 datetime,@date2 datetime
AS select top 20 a.物料代码,sum(a.总数量)as 数量合计,sum(a.总金额)as 金额合计,a.物料名称,a.型号 from
(SELECT dbo.sbilldet.itemno AS ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号