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

Redirecting Key Events

How can I capture a key event and redirect it?  I want to capture the "+" vbKeyAdd and excute the <tab> instead, without changing the text property of the textbox.
0
whitej8
Asked:
whitej8
  • 2
1 Solution
 
whitej8Author Commented:
I do not want the "+" to appear in the textbox.
0
 
TheAnswerManCommented:
sub TextBox_Keypress(keyascii as integer)

if keyascii = 43 then
  '+ Pressed
  sendkeys(vbtab)
end if
0
 
TheAnswerManCommented:
oops.. do this instead
sub TextBox_Keypress(keyascii as integer)

if keyascii = 43 then
  '+ Pressed
  keyascii = 0
  sendkeys(vbtab)
end if
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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