ssswamii

ssswamii

  • NA
  • 180
  • 0

OnPaint override

Oct 7 2003 2:39 PM
I have a class that inherits from the RichTextBox control. I need to do some custom drawing on the RichTextBox, so I override the paint event and do the custom drawing: protected override void OnPaint(PaintEventArgs e) { // draw normally base.OnPaint (e); // add our custom border ControlPaint.DrawBorder(e.Graphics, e.ClipRectangle, Color.Black, ButtonBorderStyle.Solid); } Simple enough, right? Well, when I run the app, every time I enter text into the control, the custom drawing I did gets cleared. Why is that? Is there a way around this?

Answers (8)