有一个按钮btn1
写了一个函数btn1OnMouseDown(sender:TObject);
在"Object Inspector"里,找到btn1的Events,找到"OnMouseDown",点击右边的下拉按钮,发现没有btn1OnMouseDown的选项,请问是不是在btn1OnMouseDown函数里缺少某个参数,像"var md:TOnMouseDown"一样的.
写了一个函数btn1OnMouseDown(sender:TObject);
在"Object Inspector"里,找到btn1的Events,找到"OnMouseDown",点击右边的下拉按钮,发现没有btn1OnMouseDown的选项,请问是不是在btn1OnMouseDown函数里缺少某个参数,像"var md:TOnMouseDown"一样的.
procedure OnMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
如果你想为btn1指定OnMouseDown事件可以这样--自定义处理过程
procedure MyMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);--添加事件
Button1.OnMouseDown :=MyMouseDown;