How do you detect simultaneous keypresses such as “Ctrl + T” in VB.NET?

前端 未结 5 643
甜味超标
甜味超标 2021-01-02 03:34

I am trying to detect the keys \"Control\" and \"t\" being pressed simultaneously in VB.NET. The code I have so far is as follows:

Private Sub frmTimingP2P_K         


        
5条回答
  •  盖世英雄少女心
    2021-01-02 03:54

    I dont have vb.net installed right now but try this on your keydown or keypress event:

    If e.KeyCode = Keys.T AndAlso e.Control = True Then
    MsgBox("Ctrl + T")
    End If
    

提交回复
热议问题