views:

277

answers:

1

Hello,

In C# winforms, is there a way to not show the dashed focus outline border that shows around a trackbar control when it is being used?

Details: This outline looks kinda tacky to me, so I'm just shooting for aesthetics to not show it.

Thanks,

Adam

+1  A: 

Put the following class in your application namespace:

public class NoFocusTrackBar : System.Windows.Forms.Trackbar
{
    protected override bool ShowFocusCues
    {
        get { return false; }
    }
}

This class can be used in place of the standard trackbar. It inhibits the drawing of the border around the trackbar when the trackbar gets the focus.

Robert Harvey