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?