如何避免在应用程序 运行 时选择控件时在 运行 时看到控件周围的粗矩形?
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?
这不是我的控件我是从这个页面下载的:
然后我把它从工具箱里拖到form1 designer里。
当应用程序 运行 并且我在某个时候使用 trackBar 时,就像我选择了控件并且它在它周围显示了选定的矩形。
如果我在运行时 select/use 另一个控件,trackBar 周围的矩形仍然存在。
在 MACTrackBar.cs 文件中 OnPaint
覆盖方法的底部,注释掉这些行:
// Draws a focus rectangle
// if(this.Focused)
// ControlPaint.DrawFocusRectangle(e.Graphics,
// Rectangle.Inflate(this.ClientRectangle, -2, -2));
这不是我的控件我是从这个页面下载的:
然后我把它从工具箱里拖到form1 designer里。
当应用程序 运行 并且我在某个时候使用 trackBar 时,就像我选择了控件并且它在它周围显示了选定的矩形。
如果我在运行时 select/use 另一个控件,trackBar 周围的矩形仍然存在。
在 MACTrackBar.cs 文件中 OnPaint
覆盖方法的底部,注释掉这些行:
// Draws a focus rectangle
// if(this.Focused)
// ControlPaint.DrawFocusRectangle(e.Graphics,
// Rectangle.Inflate(this.ClientRectangle, -2, -2));