你重新继承个speedbutton就行了,截获原来的speedbutton的这个消息,然后触发一个事件:
procedure TSpeedButton.CMButtonPressed(var Message: TMessage);
var
Sender: TSpeedButton;
begin
if Message.WParam = FGroupIndex then
begin
Sender := TSpeedButton(Message.LParam);
if Sender <> Self then
begin
if Sender.Down and FDown then
begin
FDown := False;
FState := bsUp;
//这里添加按钮抬起事件
if (Action is TCustomAction) then
TCustomAction(Action).Checked := False;
Invalidate;
end;
FAllowAllUp := Sender.AllowAllUp;
end;
end;
end;