protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing && painter != null) { painter.Dispose(); painter = null; } }