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

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

            btnCancel.Enabled = false;
        }
예제 #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);
        }