I have a textbox on a dotnet form and I am wanting to program an event when the Enter key is pressed.
The documentation states that the Click event is a higher level event that occurs when the Enter key is pressed, but this does not appear to be working. I've also tried the Keypress event using the Lastkey function to see if I could read the Enter key being pressed but no luck.
Any help is appreciated....Thanks.
If the documentation states that, than that's a documentation error, as the Click event has nothing to do with keyboard.
Just subscribe on the KeyDown event and check the KeyCode:
IF e:KeyCode:Equals(Keys:Enter) OR e:KeyCode:Equals(Keys:Return)
THEN /* Your code here... */
If the documentation states that, than that's a documentation error, as the Click event has nothing to do with keyboard.
Just subscribe on the KeyDown event and check the KeyCode:
IF e:KeyCode:Equals(Keys:Enter) OR e:KeyCode:Equals(Keys:Return)
THEN /* Your code here... */
"Unknown Field or Variable name - KEYS. (201)"
compile error when I try to compile this.
KEYS? I don't see this in the example that was suggested. Can you please show what line you are trying to compile.
Oh! Got it. You probably are missing the package name for the Keys enum - on the line or you need a USING statement.
Yes, thanks, I was missing a USING progress util statement at the top.
I left that out as an exercise for the user ;-)
You were missing a USING System.Windows.Forms.Keys FROM ASSEMBLY.