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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #12735 |

    I want the user to be able to invoke a lookup popping up another grid when the user presses Control-F. I am successfully reading command keys with Data_Row KeyDown:

    Private DataRow_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
    ‘read keys
    Select Case e.KeyCode

    Case Keys.Delete

    ‘This WORKS

    Case Keys.F

    If e.KeyCode = Keys.Control Then

    MsgBox(“Fire The Find Event!!”)

    End If

    ‘This DOES NOT WORK

    End Select

    Any ideas?

    Thanks.

    Imported from legacy forums. Posted by Clay Rankin (had 2305 views)

    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)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.