Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I avoid from being see the thick rectangle around a control when selecting the control at run time when the application is running?

This is not my control I downloaded it from this page :

Advanced TrackBar

Then I dragged it to form1 designer from the toolbox.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

When the application is running and I use the trackBar at some point it’s like I selected the control and it’s showing the selected rectangle around it.

and if I select/use another control at runtime the rectangle around the trackBar still exist.

Rectangle like selecting the control but at run time

>Solution :

At the bottom of the OnPaint override method in the MACTrackBar.cs file, comment out these lines:

// Draws a focus rectangle
// if(this.Focused)
//   ControlPaint.DrawFocusRectangle(e.Graphics, 
//                                   Rectangle.Inflate(this.ClientRectangle, -2, -2));
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading