/// <summary> /// Constructor method of <see cref="CustomTrackBar"/> class /// </summary> public CustomTrackBar() { MouseDown += OnMouseDownSlider; MouseUp += OnMouseUpSlider; MouseMove += OnMouseMoveSlider; SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.DoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); Font = new Font("Verdana", 8.25F, FontStyle.Bold, GraphicsUnit.Point, (byte)0); ForeColor = Color.FromArgb(123, 125, 123); BackColor = Color.Transparent; tickColor = Color.FromArgb(148, 146, 148); tickHeight = 4; trackerColor = Color.FromArgb(24, 130, 198); trackerSize = new Size(16,16); indentWidth = 6; indentHeight = 6; trackLineColor = Color.FromArgb(90, 93, 90); brushStyle = BrushStyle.LinearGradient; trackLineHeight = 3; borderStyle = CustomBorderStyle.None; borderColor = SystemColors.ActiveBorder; autoSize = true; Height = FitSize.Height; }
/// <summary> /// Reset the appearance properties. /// </summary> public void ResetAppearance() { Font = new Font("Verdana", 8.25F, FontStyle.Bold, GraphicsUnit.Point, (byte)0); ForeColor = Color.FromArgb(123, 125, 123); BackColor = Color.Transparent; tickColor = Color.FromArgb(148, 146, 148); tickHeight = 4; trackerColor = Color.FromArgb(24, 130, 198); trackerSize = new Size(16,16); //_trackerRect.Size = _trackerSize; indentWidth = 6; indentHeight = 6; trackLineColor = Color.FromArgb(90, 93, 90); trackLineHeight = 3; borderStyle = CustomBorderStyle.None; borderColor = SystemColors.ActiveBorder; //========================================================================== if(autoSize == true) Size = FitSize; Invalidate(); }