/// <summary>
 /// Raises the Paint event for child classes that are to be double buffered
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnPaint(DoubleBufferedPaintEventArgs e)
 {
     if (BufferedPaint != null)
     {
         BufferedPaint(this, e);
     }
 }
 /// <summary>
 /// Raises the Paint event
 /// </summary>
 /// <param name="e">A PaintEventArgs that represents event data</param>
 protected override sealed void OnPaint(PaintEventArgs e)
 {
     if (doubleBuffered)
     {
         DoubleBufferedPaintEventArgs pe = new DoubleBufferedPaintEventArgs(CreateGraphics(), e.ClipRectangle);
         OnPaint(pe);
         pe.Graphics.Dispose();
         e.Graphics.DrawImage(backBuffer, e.ClipRectangle, e.ClipRectangle, GraphicsUnit.Pixel);
         base.OnPaint(e);
     }
     else
     {
         DoubleBufferedPaintEventArgs pe = new DoubleBufferedPaintEventArgs(e.Graphics, e.ClipRectangle);
         OnPaint(pe);
         base.OnPaint(e);
     }
 }