procedure TStartFrm.ProgressBar1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
showMessage('A');
end;可以用MouseDown代替OnClick事件,见上面代码,鼠标点击该控件有回应。
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
showMessage('A');
end;可以用MouseDown代替OnClick事件,见上面代码,鼠标点击该控件有回应。
private
FpCalc : TNotifyEvent;//事件处理过程指针
published
property OnpCalc:TNotifyevent read FpCalc write FpCalc;{定义事件属性名}
procedure TForm1.pCalc(Sender: TObject);
begin
//
end;procedure TForm1.Button1Click(Sender: TObject);
begin
if assigned(FpCalc) then
OnpCalc(Self);
end;procedure TForm1.FormCreate(Sender: TObject);
begin
FpCalc := pCalc;{使事件处理指针指向事件处理器}
end;