Last active
August 29, 2015 14:11
-
-
Save joebuschmann/3aaf386381926ad90cd3 to your computer and use it in GitHub Desktop.
Override Form.ProcessDialogKey to suppress automatic handling of accept button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected override bool ProcessDialogKey(Keys keyData) | |
| { | |
| // Suppress the accept button when the filter editor has the focus. | |
| // This doesn't work in the KeyDown or KeyPress events. | |
| if((keyData == Keys.Return) && (filterEditor.ContainsFocus)) | |
| return true; | |
| return base.ProcessDialogKey(keyData); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment