예제 #1
0
파일: Form.cs 프로젝트: yzwbrian/SystemEx
 protected virtual void OnCancelPreview(CancelPreviewEventArgs e)
 {
     if (CancelPreview != null)
     {
         CancelPreview(this, e);
     }
 }
예제 #2
0
파일: Form.cs 프로젝트: yzwbrian/SystemEx
        protected override bool ProcessDialogKey(Keys keyData)
        {
            //
            // Overrides the default handling of the Escape key. When a cancel
            // button is present, the Escape key is not published through
            // KeyPreview. Because of this, no alternative handling is possible.
            // This override catches the Escape key before it is processed by
            // the framework and cancels default handling when the CancelPreview
            // event signals it has handled the Escape key.
            //

            if ((keyData & (Keys.Alt | Keys.Control)) == Keys.None)
            {
                Keys keyCode = (Keys)keyData & Keys.KeyCode;

                if (keyCode == Keys.Escape)
                {
                    var e = new CancelPreviewEventArgs();

                    OnCancelPreview(e);

                    if (e.Handled)
                    {
                        return(true);
                    }
                }
            }

            return(base.ProcessDialogKey(keyData));
        }
예제 #3
0
파일: Form.cs 프로젝트: pvginkel/SystemEx
        protected override bool ProcessDialogKey(Keys keyData)
        {
            //
            // Overrides the default handling of the Escape key. When a cancel
            // button is present, the Escape key is not published through
            // KeyPreview. Because of this, no alternative handling is possible.
            // This override catches the Escape key before it is processed by
            // the framework and cancels default handling when the CancelPreview
            // event signals it has handled the Escape key.
            //

            if ((keyData & (Keys.Alt | Keys.Control)) == Keys.None)
            {
                Keys keyCode = (Keys)keyData & Keys.KeyCode;

                if (keyCode == Keys.Escape)
                {
                    var e = new CancelPreviewEventArgs();

                    OnCancelPreview(e);

                    if (e.Handled)
                    {
                        return true;
                    }
                }
            }

            return base.ProcessDialogKey(keyData);
        }
예제 #4
0
파일: Form.cs 프로젝트: pvginkel/SystemEx
 protected virtual void OnCancelPreview(CancelPreviewEventArgs e)
 {
     if (CancelPreview != null)
     {
         CancelPreview(this, e);
     }
 }