1

我使用TAdvGlowButtonTMS 中的按钮控件,默认情况下它将Down属性设置为 true on MouseDown。我希望能够在需要时防止将此属性设置为 True。MouseDown 的执行流程从类的 MouseDown 过程开始:

procedure TAdvCustomGlowButton.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
  Y: Integer);
...
begin
  inherited; // Calls my local OnMouseDown method
  ...        // <- I would like to skip/cancel/stop execution after inherited call, so it never gets to Down := True line
  Down = True; 
  ...

end;

我有我的本地按钮 OnMouseDown:

procedure TForm1.AdvGlowButton1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ShowMessage('Local Mouse Down');
  if True then
    AdvGlowButton1.OnMouseDown:=nil; //<- I would like to stop execution 
end;

我试图将 OnMouseDown 设置为 nil,但这不起作用,执行流程返回到 MouseDown 并继续进行。

如果可能的话,我想避免更改原始课程中的任何内容。

有没有办法在原始继承调用后停止/中止/取消进一步执行?

4

0 回答 0