protected override void OnResize(EventArgs e)
{
// Recreate the buffer for manual double buffering
if (this.Width > 0 && this.Height > 0){
if (this._BackImage != null){
this._BackImage.Dispose();
this._BackImage = null;
}
if (this._BackBufferGraphics != null){
this._BackBufferGraphics.Dispose();
}
if (this._BackBuffer != null){
this._BackBuffer.Dispose();
}
this._BackBuffer = new Bitmap(this.Width, this.Height);
this._BackBufferGraphics = Graphics.FromImage(this._BackBuffer);
if (this._TabBufferGraphics != null){
this._TabBufferGraphics.Dispose();
}
if (this._TabBuffer != null){
this._TabBuffer.Dispose();
}
this._TabBuffer = new Bitmap(this.Width, this.Height);
this._TabBufferGraphics = Graphics.FromImage(this._TabBuffer);
if (this._BackImage != null){
this._BackImage.Dispose();
this._BackImage = null;
}
}
base.OnResize(e);
}