This is the code I use to ensure that OnPaint is called after the RichTextBox has processed the picture first:
class MyRichTextBox: RichTextBox { private const int WM_PAINT = 15; protected override void WndProc(ref System.Windows.Forms.Message m) { base.WndProc (ref m); if (m.Msg == WM_PAINT && !inhibitPaint) {
source share