/// <summary> /// Disposed the <see cref="MemoryBitmap"/> and redraws the control /// </summary> protected virtual void ResizeControl() { if (MemoryBitmap != null) { MemoryBitmap.Dispose(); MemoryBitmap = null; } if (ClientSize.Width != 0 && ClientSize.Height != 0) { MemoryBitmap = new Bitmap(ClientSize.Width, ClientSize.Height); } Invalidate(); }