procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Key = VK_DELETE then
    //
end;
—————————————————————————————————
MaximStr := '宠辱不惊,看庭前花开花落,去留无意;
             毁誉由人,望天上云卷云舒,聚散任风。';
if Not Assigned(I) then
  I := TI.Create(Nil);
I.Maxim := MaximStr;
I.Desire := '加不加分随你';
—————————————————————————————————
       

解决方案 »

  1.   

    我是在procedure TMDIChild.Map1KeyPress(Sender: TObject; var Key: Char);事件处理的.主要是它根本就不响应"DELETE"键,只能捕获!
      

  2.   

    unit Unit1;
    interface
    uses
      Windows, Messages, shellapi,SysUtils, Classes, Graphics, Controls, Forms,
      Dialogs;
    type
      TForm1 = class(TForm)
        procedure FormCreate(Sender: TObject);
        procedure MyProcedure(var Msg: TMsg; var Handled: Boolean);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    var
      Form1: TForm1;
    implementation
    {$R *.dfm}
    procedure TForm1.MyProcedure(var Msg: TMsg; var Handled: Boolean);
     begin
       if msg.message=WM_KEYDOWN then
          if msg.wParam=VK_DELETE then
             showmessage('Press Del!');
     end;
    procedure TForm1.FormCreate(Sender: TObject);
    begin
     application.OnMessage:=MyProcedure;
    end;
    end.
      

  3.   

    keypress里面不出发del
    ================================================================
    充电中...
      

  4.   

    给个例子你看:
    Procedure TForm1.WinMsg (Var Msg : TMsg; Var Handled : Boolean);
    Begin
      if (Msg.message<>15)and(Msg.message<>17)and(Msg.message<>512)
        and(Msg.message<>160)and(Msg.message<>513)and(Msg.message<>280) then
        memo1.Text := memo1.Text +'#'+ inttostr(Msg.Message);
      If Msg.Message = WM_SYSCOMMAND Then begin
        Beep;
        Application.MessageBox( 'OK!', '操作提示', MB_OK + MB_ICONINFORMATION );
      end;
      { 接收到消息时的通知}
      if msg.message = SC_MOUSEMENU then
        Application.MessageBox( 'mouseOK!', '操作提示', MB_OK + MB_ICONINFORMATION );
      if msg.message = 516 then begin//鼠标移动
         msg.message := 0;
    //    Application.MessageBox( 'mouseOK!', '操作提示', MB_OK + MB_ICONINFORMATION );
      end;
      
    End;procedure TForm1.FormCreate(Sender: TObject);
    begin
      Application.OnMessage := WinMsg;
    end;
      

  5.   

    你该仔细看看onkeypress的帮助
    它明确的说要捕获del 发向建得在onkeydown or onkeyup