if Button = mbLeft then // 左键 if Button = mbRight then //右键
if button=mbLeft then showmessage('左键'); if button=mbRight then showmessage('右键');
使用 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;
忘了加上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;
if Button = mbRight then //右键
showmessage('左键');
if button=mbRight then
showmessage('右键');
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;
procedure 你的鼠标事件(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);beginif ssLeft in shift thenbegin
//这里是左键要执行的语句
end;else if ssRight in shift thenbegin
//这里是右键执行的语句
end;end;
:)SORRY