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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect Enter Key (Return) down 1

Status
Not open for further replies.

ZmrAbdulla

Technical User
Apr 22, 2003
4,364
AE
Here is the one from VB6/VBA
Code:
If KeyCode = vbKeyReturn Then
How do you replace it in VB.NET? It is something like.
Code:
If System.Windows.Forms.Keys.Return Then
but I can't get it working.
Can anyone help me?

________________________________________________________
Zameer Abdulla
Help to find Missing people
My father was a realistic father; not a vending machine dispense everything I demanded for!!
 
There are three keyboard events:

KeyDown, KeyUp and KeyPress

The e parameter contains the details of which key was pressed as follows:

KeyPress:
e.KeyChar is the character

KeyUp, KeyDown:
e.KeyCode, e.KeyValue and e.KeyData
e.KeyCode returns data from the Keys as in your example above, but have a look in help for KeyEventArgs for a more detailed explanation.


Hope this helps.

[vampire][bat]
 
Thanks earthandfire,
Now it is working..
Code:
If e.KeyCode = System.Windows.Forms.Keys.Return Then
I will do more experiments as I require in the development.

________________________________________________________
Zameer Abdulla
Help to find Missing people
My father was a realistic father; not a vending machine dispense everything I demanded for!!
 
By the way Zameer, welcome to the VB.Net forum - do you still frequent the Access forums? I rarely have time these days.

[vampire][bat]
 
Thanks..
I was just to (re)invite you to the Access Forums. People there desperately need persons like you.

I am not forgetting PHV, RoyVidar and others.

________________________________________________________
Zameer Abdulla
Help to find Missing people
My father was a realistic father; not a vending machine dispense everything I demanded for!!
 
And we desperately need to get rid of him. ;-)

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Thanks, Zameer.

chrissie - well - what can I say? Its nice to know how welcome I am here [lol]

[vampire][bat]
 
chrissie1,
Are you jealous seeing him on the top of the list?[wink]

________________________________________________________
Zameer Abdulla
Help to find Missing people
My father was a realistic father; not a vending machine dispense everything I demanded for!!
 
Never.

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
But I am.. [wink]
earthandfire, keep it up [thumbsup2]

________________________________________________________
Zameer Abdulla
Help to find Missing people
My father was a realistic father; not a vending machine dispense everything I demanded for!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top