Annoying button border appear after tabbing

Sunny Sharma 1 Reputation point
2022-11-09T16:56:11.133+00:00

We have a dotnet winform application which has form with different input controls along with Search button. If we just fill the input controls with data and navigate through different input controls using tabbing, it works fine and we expect the border around search button to appear while using tabbing but if we use a tabbing with all input controls and then later click on search button using a mouse hover, it has a black border which appears by default and we are unable to remove the border even by setting the value button.FlatStyle = FlatStyle.Flat;
button.FlatAppearance.BorderSize = 0;

Is there any fix that can be applied to remove the border around search button if we need to have tabbing in controls in place. I have seen number of posts but did not get any workable solution which satisfies both the tabbing and the removal of border around search button. Please note if we get border around search button while tabbing it's fine, it's only when we use tabbing and next time if we use mouse to click the search button it creates border around the search button which is causing issue.

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,837 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,294 questions
{count} votes