Button = mbLeft或Button = mbRight

解决方案 »

  1.   

    if Button = mbLeft then // 左键
    if Button = mbRight then //右键
      

  2.   

    if button=mbLeft then
      showmessage('左键');
    if button=mbRight then
    showmessage('右键');
      

  3.   

    使用
    ssLeft in shift 和ssRight in shift
    是一个Boolean值,为True表示按的就是对应的键.procedure 你的鼠标事件(Sender: TObject;
      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);if ssLeft in shift then
    begin
    //这里是左键要执行的语句
    end;
    else if ssRight in shift then
    begin
    //这里是右键执行的语句
    end;
    end;
      

  4.   

    忘了加上begin了,自己加吧.
    procedure 你的鼠标事件(Sender: TObject;
      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);beginif ssLeft in shift thenbegin
    //这里是左键要执行的语句
    end;else if ssRight in shift thenbegin
    //这里是右键执行的语句
    end;end;
      

  5.   

    曾半仙的不错,我为什么强调,因为我和他是几百年前是一家哟。
    :)SORRY