【发布时间】:2015-05-24 10:07:57
【问题描述】:
我在我的应用程序中使用TPaintBox。已经设置了几个鼠标事件处理程序:鼠标按下、鼠标抬起等。但是,我还想响应键盘输入:如果用户按下任何功能键,我想执行一个单独的过程(事件处理程序)而不是Mouse* 事件处理函数。但我还需要新程序中的鼠标位置。
我该如何编码,因为TPaintBox 不支持任何按键事件?
procedure TForm1.PaintBox1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
// here some code
end;
procedure TForm1.PaintBox1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
// more code here
end;
procedure TForm1.PaintBox1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
// here other code
end;
【问题讨论】:
标签: delphi