Detect Esc+R on textbox

Posted on 2003-02-23
Medium Priority
Last Modified: 2010-04-07
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
Question by:sambha03
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

Mennovdh earned 150 total points
ID: 8006777
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.

Author Comment

ID: 8014594
Thanks. I am giving a B since I had make some changes but I got the general idea. Thanks a lot for the help.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question