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