OnPaint override
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?
katanaPosted Oct 8, 2003, 12:08 PM
andrewPosted Oct 8, 2003, 11:51 AM
ssswamiiPosted Oct 8, 2003, 11:23 AM
Mahesh ChandPosted Oct 8, 2003, 9:21 AM
chrishornbergerPosted Oct 7, 2003, 7:51 PM
katanaPosted Oct 7, 2003, 7:14 PM
chrishornbergerPosted Oct 7, 2003, 6:09 PM
katanaPosted Oct 7, 2003, 5:13 PM