Remove blue outlining of buttons

Tim Kathete Stadler picture Tim Kathete Stadler · Jan 16, 2013 · Viewed 9.5k times · Source

Possible Duplicate:
How to set/change/remove focus style on a Button in C#?

Is there a way to remove the blue outlining when a button is pressed/was pressed/is active?

Here is a screenshot:

Blue outlining

Is there any way to hide it? I am using C# and winforms.

Answer

Jodrell picture Jodrell · Jan 16, 2013

Amalgamating the answers from the duplicate question

public class NoFocusCueButton : Button
{
    public NoFocusCueButton() : base()
    {
        InitializeComponent();

        this.SetStyle(ControlStyles.Selectable, false);
    }

    protected override bool ShowFocusCues
    {
        get
        {
           return false;
        }
    }
}