procedure Tkhdw.SpeedButton8Click(Sender: TObject);

解决方案 »

  1.   

    应该在keydown下写这段话,down表示按下的瞬间,
    在keypress下是不会触发的。
      

  2.   

    不对阿 ,不是这个样子的我是想点击SpeedButton3执行一个事情
    在点击SpeedButton2由执行一件事情。可是我始终得不到这两个按钮的
    状态没法实现
      

  3.   

    procedure TForm1.SpeedButton8Click(Sender: TObject);
    begin
      if Sender is TSpeedButton then
      begin
        application.MessageBox(PChar(
          '您使用的是'+TSpeedButton(Sender).Name+'这个按钮'),
          '错误',mb_iconinformation+mb_retrycancel+mb_defbutton1);
      end;
    end;
      

  4.   

    使用DataSet.State=dsEdit或DataSet.State=dsInsert来判断。
      

  5.   

    procedure TForm1.SpeedButton8Click(Sender: TObject);
    begin
      if Sender is TSpeedButton then
      begin
        application.MessageBox(PChar(
          '您使用的是'+TSpeedButton(Sender).Name+'这个按钮'),
          '错误',mb_iconinformation+mb_retrycancel+mb_defbutton1);
      end;
    end;