public class DateTimeTrackBar : TrackBar { : public DateTimeTrackBar() { : SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); base.SetStyle(ControlStyles.UserPaint, false); base.Refresh(); // Use default paint implementation. // Adding additional paint code. if (ShowLabels) DrawLabels(e); // Works fine. base.SetStyle(ControlStyles.UserPaint, true); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)