when we set the button to the following properties, there is always a focus frame that bothers us .
Button1. FlatStyle = FlatStyle.Flat;
The effect we want is this:
but when using the Tab Toggles focus when the button gets the focus, it looks like this.
What the hell is this black box ? Now let's talk about how to get rid of this focus frame .
Method One :
someone must want to use a label Ah, of course , the label is OK, but it is not a button, some effects have to write their own ....
FA II:
1. creating a new custom control
2. Code
public partial class btnnoborder:button{///<summary>///construction//</summary>public Btnnoborder () { InitializeComponent ();} <summary>///Redraw///</summary>///<param name= "PE" ></param>protected override void OnPaint ( PaintEventArgs pe) { base. OnPaint (PE);} <summary>///Cancel Focus box//</summary>protected override bool showfocuscues{ get { return false;}}}
That's it, you can drag the button from the toolbox when you use it.
Specifically, how to add this control to the Toolbox does not introduce
Bye!
Rookie Peck: WinForm How to Implement button buttons without a focus frame