void EnableCancel() { if (!btnCancel.Enabled) { SystemMenu.EnableCloseButton(this); } btnCancel.Enabled = true; }
void DisableCancel() { if (btnCancel.Enabled) { SystemMenu.DisableCloseButton(this); } btnCancel.Enabled = false; }
protected override void OnSizeChanged(EventArgs e) { // handle the effect of minimize/restore on // disabling the "close" button & menu item if (!btnCancel.Enabled) { SystemMenu.DisableCloseButton(this); } base.OnSizeChanged(e); }