View Single Post
Old 05-28-2019, 04:41 PM
rojam rojam is offline
Senior Member
Join Date: Jun 2015
Posts: 198

if you want a group of buttons to work in concert then lookup the speedbutton's GroupIndex property, if you simply want a button to toggle down or up every time the user clicks it, then just toggle the speedbutton's down property in its OnClick handler.
procedure TFomr1.SpeedButtonClick(Sender: TObject);
  (Sender as TSpeedButton).Down := Not ((Sender as TSpeedButton).Down);
with casting Sender as TSpeedButton, you can use this same method for all speedbutton's that you would like to toggle.

***This code with only work if Sender is a TSpeedButton, else it is likely to crash.