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.
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.
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;
}
}
}
create a new class and inherit class Button
, eg
public class OnetsButton : Button
{
public OnetsButton()
{
this.SetStyle(ControlStyles.Selectable, false);
}
}
I have a solution now, it's not very sexy, but it works. I just added an invisible button to the form and now everytime a button is clicked, I select the invisible button. Works for me.