How to remove the focus rectangle using the control button?

I need to remove the focus rectangle of the button because it does not look well above the TBitBtn TBitBtn after clicking the buttons.

+6
source share
2 answers

You can create an Interposer class for TBitBtn and override SetButtonStyle to prevent its internal variable IsFocused :

 type TBitBtn = class(Buttons.TBitBtn) protected procedure SetButtonStyle(ADefault: Boolean); override; end; ... implementation procedure TBitBtn.SetButtonStyle(ADefault: Boolean); begin inherited SetButtonStyle(False); end; 

This will result in TBitBtn without the focus rectangle. (Tested with D7 - with / without theme support).

+6
source

As a workaround, you can use TSpeedButton , which does not take focus and therefore never gets the focus rectangle.

+3
source

All Articles