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

delphi7中在edit中敲enter(回車)的ascii不是13嗎?怎會事啊想觸發的事情觸發不了?该怎么处理

2012-02-20 
delphi7中在edit中敲enter(回車)的ascii不是13嗎?怎會事啊?想觸發的事情觸發不了?Delphi7.0中Edit1中敲Ent

delphi7中在edit中敲enter(回車)的ascii不是13嗎?怎會事啊?想觸發的事情觸發不了?
Delphi7.0中Edit1中敲Enter(回車)鍵怎不會響應showmessage('ssssss');而要shift+Enter才會showmessage('ssssss');

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then showmessage('ssssss');
end;



[解决办法]
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key=VK_RETURN then showmessage( 'ssssss ');
end;

热点排行