Control.IsInputKey Method (Keys)
Determines whether the specified key is a regular input key or a special key that requires preprocessing.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
[<UIPermissionAttribute(SecurityAction.InheritanceDemand, Window = UIPermissionWindow.AllWindows)>] abstract IsInputKey : keyData:Keys -> bool [<UIPermissionAttribute(SecurityAction.InheritanceDemand, Window = UIPermissionWindow.AllWindows)>] override IsInputKey : keyData:Keys -> bool
Return ValueType: System.Boolean
true if the specified key is a regular input key; otherwise, false.
Call themethod to determine whether the key specified by the keyData parameter is an input key that the control wants. This method is called during window message preprocessing to determine whether the specified input key should be preprocessed or sent directly to the control. If returns true, the specified key is sent directly to the control. If returns false, the specified key is preprocessed and only sent to the control if it is not consumed by the preprocessing phase. Keys that are preprocessed include the TAB, RETURN, ESC, and the UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW keys.
Legacy Code Example
The following code example shows you how to override the TextBox control. In this example, the TabTextBox class handles the TAB key. When the TabTextBox has the focus and the user presses the TAB key four spaces are added at the text insertion point, replacing any selected text. By default, the TextBox control handles the TAB key by moving the input focus to the next control. In this case, the keypress never reaches the OnKeyDown method override. To prevent this default behavior, the method override returns true when the user presses the TAB key. For all other keypresses, the method override returns the result of calling the base-class version of the method.method for a
for all windows for inheriting classes to call this method. Associated enumeration: AllWindows value of UIPermissionWindow.
Available since 1.1