事件的参数里有key,可以利用

解决方案 »

  1.   

    在Form的KeyPress中有Key参数,可以这样用  if key=#13(回车键) then 但keypreview需要设为true
      

  2.   

    if key = vk_delete then 
      

  3.   

    把Form的keypreview := true;form 的onkeydown,onkeypress,都能处理。
    你说的功能键在onkeydown过程里加入下面的代码  procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      if Key = vk_delete then showmessage('hit Delete Key');
    end;为什么不搜索一下先。
      

  4.   

    顺便补充一下:keydown事件在按下键到松开之间一直不停发生;而keypress只发生一次。
      

  5.   

    delphi自带的例子很多都用了,自己看一看