Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return value - keystroke

Status
Not open for further replies.

kjoost001

Programmer
Apr 11, 2002
19
0
0
US
In VB, does anyone know the command for a Return Keystroke? Is it even possible?

Thanks
 
I may have misunderstood your Q If you want to detect that someone has hit the enter(return) key ?

In the keydown event check for keycode 13
 
I was wondering the same thing .. do you want to detect someone hitting the enter key, or actually send an enter key press to the app ??

Transcend
[gorgeous]
 
thanks for responding, sorry for not clarifying. I want to actually send a enter key press to the app.
 
In that case SonOfEmidec1100's first suggestion of using
SENDKEYS {ENTER} is what you need.


Transcend
[gorgeous]
 
OK then its SENDKEYS you want to use.
Along the lines SendKeys "{ENTER}", True

This will send enter to the active control on the active form unless you have keypreview set to true then it will be intercepted by the form keypress event of the form.... I think

good luch
 

>I want to actually send a enter key press to the app

Will you be doing this (sending the key stroke) in the same application that is to receive the key stroke?

If so, then using SendKeys may be the wrong method. It can cause alot of grief if used wrong. There are then other methods for doing what you want if the above applies. [/b][/i][/u][sub]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
It's still not quite clear from your question what you are trying to achieve

The intrinsic constant vbCRLF will give a carriage return Chr(13) and a line feed Chr(10)
If you want to put the equivalent of Enter key onto the end of some text then:
strSomeText = strSometext & vbCRLF

If none of these suggestions has solved it for you check out faq222-2244 to clarify your question
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top