85 references to KeyCode
System.Windows.Forms (64)
System\Windows\Forms\Control.cs (2)
7616&& (e.KeyCode.HasFlag(Keys.ControlKey) || e.KeyCode == Keys.Escape))
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (1)
1163if (kevent.KeyCode is Keys.Enter or Keys.Space)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (3)
2441if (e.KeyCode == Keys.Return) 2446else if ((e.KeyCode == Keys.Escape) && _autoCompleteDroppedDown) 2491if (IsAccessibilityObjectCreated && _childEdit is not null && ContainsNavigationKeyCode(e.KeyCode))
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (5)
21898if (ke.KeyCode != Keys.ProcessKey || m.LParamInternal != 0x01) // Changing IME context does not trigger editing mode 21913if (BeginEditInternal(selectAll: !(ke.KeyCode == Keys.F2 && ModifierKeys == 0 && EditMode == DataGridViewEditMode.EditOnKeystrokeOrF2))) 21953? ke.KeyCode switch 21958: ke.KeyCode switch 24432switch (e.KeyCode)
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (4)
440e.KeyCode == Keys.Space && !e.Alt && !e.Control && !e.Shift; 443e.KeyCode == Keys.Space; 464if (e.KeyCode == Keys.Space && !e.Alt && !e.Control && !e.Shift) 478if (e.KeyCode == Keys.Space)
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (4)
758e.KeyCode == Keys.Space && !e.Alt && !e.Control && !e.Shift; 760protected override bool KeyUpUnsharesRow(KeyEventArgs e, int rowIndex) => e.KeyCode == Keys.Space; 812if (e.KeyCode == Keys.Space && !e.Alt && !e.Control && !e.Shift) 826if (e.KeyCode == Keys.Space)
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (13)
1512if (((char.IsLetterOrDigit((char)e.KeyCode) && !(e.KeyCode >= Keys.F1 && e.KeyCode <= Keys.F24)) || 1513(e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.Divide) || 1514(e.KeyCode >= Keys.OemSemicolon && e.KeyCode <= Keys.Oem102) || 1515(e.KeyCode == Keys.Space && !e.Shift) || 1516(e.KeyCode == Keys.F4) || 1517((e.KeyCode == Keys.Down || e.KeyCode == Keys.Up) && e.Alt)) && 1518(!e.Alt || (e.KeyCode == Keys.Down || e.KeyCode == Keys.Up)) &&
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (2)
685if (e.KeyCode == Keys.Space && !e.Alt && !e.Control && !e.Shift) 731if (e.KeyCode == Keys.Space && !e.Alt && !e.Control && !e.Shift)
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (8)
534if (((char.IsLetterOrDigit((char)e.KeyCode) && !(e.KeyCode >= Keys.F1 && e.KeyCode <= Keys.F24)) || 535(e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.Divide) || 536(e.KeyCode >= Keys.OemSemicolon && e.KeyCode <= Keys.Oem102) || 537(e.KeyCode == Keys.Space && !e.Shift)) &&
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
797if (e.KeyCode == Keys.Enter)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (7)
2322if (e.KeyCode == Keys.Return) 2487if (!e.Alt && (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)) 2496bool processed = ProcessEnumUpAndDown(gridEntry, e.KeyCode); 2502else if ((e.KeyCode == Keys.Left || e.KeyCode == Keys.Right) 2693Keys keyCode = e.KeyCode;
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
804if (_splitTarget is not null && e.KeyCode == Keys.Escape)
System\Windows\Forms\Controls\TabControl\TabControl.cs (3)
1376if (ke.KeyCode == Keys.Tab && (ke.KeyData & Keys.Control) != 0) 1382if (ke.KeyCode == Keys.PageDown && (ke.KeyData & Keys.Control) != 0) 1387if (ke.KeyCode == Keys.PageUp && (ke.KeyData & Keys.Control) != 0)
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (2)
1854Keys keyCode = e.KeyCode; 2041if (IsHandleCreated && IsAccessibilityObjectCreated && ContainsNavigationKeyCode(e.KeyCode))
System\Windows\Forms\Controls\TextBox\TextBox.cs (1)
654if (IsHandleCreated && IsAccessibilityObjectCreated && ContainsNavigationKeyCode(e.KeyCode))
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (4)
425if (InterceptArrowKeys && (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down) && !Spinning) 438if (InterceptArrowKeys && (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down))
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (1)
613if (e.KeyCode == Keys.Return && UserEdit)
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownEdit.cs (1)
107if (IsHandleCreated && IsAccessibilityObjectCreated && ContainsNavigationKeyCode(e.KeyCode))
System\Windows\Forms\DataBinding\BindingNavigator.cs (1)
745switch (e.KeyCode)
System.Windows.Forms.Design (14)
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (1)
96if (kevent.KeyCode is Keys.Down && _showSplit)
System\ComponentModel\Design\DateTimeEditor.DateTimeUI.cs (1)
46switch (e.KeyCode)
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (3)
189if (e.KeyCode == Keys.Down) 219if (e.KeyCode == Keys.Up) 263if (e.KeyCode == Keys.Enter)
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (1)
106if (e is { Control: true, KeyCode: Keys.Return, Modifiers: Keys.Control })
System\ComponentModel\Design\ObjectSelectorEditor.Selector.cs (1)
94Keys key = e.KeyCode;
System\Drawing\Design\ColorEditor.ColorPalette.cs (1)
273switch (e.KeyCode)
System\Drawing\Design\ColorEditor.ColorUI.cs (1)
284if (ke.KeyCode == Keys.Return)
System\Drawing\Design\SelectionPanelBase.cs (1)
64Keys key = e.KeyCode;
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
1037if ((e.Modifiers) == 0 && e.KeyCode == Keys.F4)
System\Windows\Forms\Design\StringCollectionEditor.StringCollectionForm.cs (1)
38if (e.KeyCode != Keys.Escape)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (2)
1074switch (e.KeyCode) 1109if (e.KeyCode == Keys.A && (e.KeyData & Keys.Control) != 0)
System.Windows.Forms.Tests (6)
System\Windows\Forms\KeyEventArgsTests.cs (2)
36Assert.Equal((Keys)e.KeyValue, e.KeyCode); 40Assert.Equal(Keys.None, e.KeyCode);
System\Windows\Forms\SendKeysTests.cs (4)
19Assert.Equal(Keys.ControlKey, form.KeyEvents[0].KeyCode); 20Assert.Equal(Keys.A, form.KeyEvents[1].KeyCode); 22Assert.Equal(Keys.ControlKey, form.KeyEvents[2].KeyCode); 23Assert.Equal(Keys.C, form.KeyEvents[3].KeyCode);
WinFormsControlsTest (1)
RichTextBoxes.cs (1)
96if (e.Control && e.KeyCode == Keys.F)