Home Forums WinForms controls Xceed Grid for WinForms How To Invoke Find in Grid Using Control-F Reply To: How To Invoke Find in Grid Using Control-F

User (Old forums)
Member
Post count: 23064

To see wether the Control-key is pressed, you should check e.Control instead of e.KeyCode. KeyCode can’t be both Keys.Control and Keys.F at the same time.

What I do is:

If Not e.Control And Not e.Shift And Not e.Alt Then ‘ check for all 3 modifiers

<color=”#0000FF”>If e.KeyCode = Keys.Delete Then
‘ The Delete-key is pressed
End If</color>

ElseIf e.Control And Not e.Shift And Not e.Alt Then ‘ Control, but not Shift and not Alt

<color=”#0000FF”>If e.KeyCode = Keys.F Then
‘ Control+F is pressed
ElseIf e.KeyCode = Keys.G Then
‘ Control+G is pressed
ElseIf …..
End If</color>

ElseIf Not e.Control And e.Shift And Not e.Alt Then ‘ Shift, but not Control and not Alt

<color=”#0000FF”>….</color>

End If

Imported from legacy forums. Posted by Tommy (had 3431 views)