This is fairly easy...
If I click button1 with the mouse button, it does what it was supposed to do...
But you know, like in MSN messenger, you don't have to click the "send" button, you can just press enter.
So, how can I do this with my button?
Printable View
This is fairly easy...
If I click button1 with the mouse button, it does what it was supposed to do...
But you know, like in MSN messenger, you don't have to click the "send" button, you can just press enter.
So, how can I do this with my button?
Hi,Quote:
Originally Posted by kakemot
Make that your button has the 'Focus' Enter and you'll see that the button does what he supposed to do.
Wkr,
sparrow1
Yea, ok, I know that...
But then I will always have to "unfocus" the typing field.
But whatever, I am close to solve this myself now. ;)
Hi,Quote:
Originally Posted by kakemot
I didn't know that you needed more.
Here's a link about the Keypressevent, you might needed to solve your problem;
http://msdn2.microsoft.com/en-us/lib...s.handled.aspx
Wkr,
sparrow1
Ok, thanks! :D
EDIT:
Nothing works.
Well, I will solve this somehow.
Why do they make it so hard?
It could just be a function like this:
if keyboard_check_pressed(key_enter) = true then MsgBox("lol, you pressed enter")
:rolleyes:
Try this:
It's something like that. Is that what you wanted?Code:If e.Keycode = Keys.Enter Then
Button1.ProcessClick();
End If
Yes, but it doesn't really work...
It says that "Keycode" is not a member of KeyPressEventArgs.
Shouldn't it be? :S
EDIT:
Well, Keychar is, but it doesn't work with "=".
The Form this button is on has a Property call "AcceptButton"Quote:
Originally Posted by kakemot
Set the Property to your button...Button1...
This should do exactly what you need with no code.
This just monitors the form for the "Enter" key then fires the "AcceptButtons" Click event.
HTH.
Good Luck!
Matt
YAY!
Thank you!
^^
Yes, it worked.
Forgot to add...
the form KeyPreview propoerty must be set to True.
Matt