This rectangle that appears on your button is called the "focus rectangle." It indicates which control on the form has input focus.
The explanation of the problem you are working with is that even when the button is not a tab, it is still selected when it is clicked on with the mouse, and therefore the focus rectangle still appears. The property TabStoponly determines whether the control can receive focus using the key Tab, and not regardless of whether the user selects it.
A focus rectangle is useful to indicate to a user who has focus. Pressing the keys Enteror Spacewith the selected button will cause the button to be pressed. Without a focus rectangle, keyboard users may find it difficult to navigate your application.
, (, , ), Enabled False. , .
, , , ( , ), , Button. ShowFocusCues ( True Button) False. :
public class NoFocusButton : Button
{
protected override bool ShowFocusCues
{
get
{
return false;
}
}
}
OnPaint . ( ), , . . .