Remove blue outlining of buttons

button, c#, outlining, user-interface, winforms

Solution

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;
        }
    }
}

Problem

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: Is there any way to hide it? I am using C# and winforms.

Original source

Related problems