• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Detect Esc+R on textbox

How can i detect esc+R on a textbox?
I currently have other key captures in Keydown event of text box. Is there a way to add code to the one below to detect esc+R ?

Private Sub TextBox1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim CtrlDown
CtrlDown = (Shift And vbCtrlMask) > 0
Select Case KeyCode
   Case vbKeyA
     if CtrlDown then msgbox "control and A pressed!"
end select
0
sambha03
Asked:
sambha03
1 Solution
 
MennovdhCommented:
This is the best I could come up with;

Dim swEscape As Boolean

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    swEscape = (KeyCode = 27)
    If KeyCode = 82 Then
        MsgBox "Esc-R"
    End If
End Sub

Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
    swEscape = (KeyCode = 27) And swEscape
End Sub


It's not perfect, but it should do the job.
0
 
sambha03Author Commented:
Thanks. I am giving a B since I had make some changes but I got the general idea. Thanks a lot for the help.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now