Example #1
0
        void EnableCancel()
        {
            if (!btnCancel.Enabled)
            {
                SystemMenu.EnableCloseButton(this);
            }

            btnCancel.Enabled = true;
        }
Example #2
0
        void DisableCancel()
        {
            if (btnCancel.Enabled)
            {
                SystemMenu.DisableCloseButton(this);
            }

            btnCancel.Enabled = false;
        }
Example #3
0
        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);
        }