|
-
Oct 29th, 2006, 08:01 AM
#1
Thread Starter
Member
[RESOLVED] Pressing enter instead of clicking...
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?
kakemot.com
Submit your games or applications to kakemot.com!
-
Oct 29th, 2006, 08:13 AM
#2
Re: Pressing enter instead of clicking...
 Originally Posted by kakemot
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,
Make that your button has the 'Focus' Enter and you'll see that the button does what he supposed to do.
Wkr,
sparrow1
-
Oct 29th, 2006, 08:18 AM
#3
Thread Starter
Member
Re: Pressing enter instead of clicking...
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.
kakemot.com
Submit your games or applications to kakemot.com!
-
Oct 29th, 2006, 08:24 AM
#4
Re: Pressing enter instead of clicking...
 Originally Posted by kakemot
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,
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
-
Oct 29th, 2006, 08:26 AM
#5
Thread Starter
Member
Re: [RESOLVED] Pressing enter instead of clicking...
Ok, thanks! 
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")
Last edited by kakemot; Oct 29th, 2006 at 08:52 AM.
kakemot.com
Submit your games or applications to kakemot.com!
-
Oct 29th, 2006, 08:51 AM
#6
Frenzied Member
Re: [RESOLVED] Pressing enter instead of clicking...
Try this:
Code:
If e.Keycode = Keys.Enter Then
Button1.ProcessClick();
End If
It's something like that. Is that what you wanted?
-
Oct 29th, 2006, 08:56 AM
#7
Thread Starter
Member
Re: [RESOLVED] Pressing enter instead of clicking...
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 "=".
kakemot.com
Submit your games or applications to kakemot.com!
-
Oct 29th, 2006, 10:12 AM
#8
Lively Member
Re: [RESOLVED] Pressing enter instead of clicking...
 Originally Posted by kakemot
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?
The Form this button is on has a Property call "AcceptButton"
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
-
Oct 29th, 2006, 10:15 AM
#9
Thread Starter
Member
Re: [RESOLVED] Pressing enter instead of clicking...
YAY!
Thank you!
^^
Yes, it worked.
Last edited by kakemot; Oct 29th, 2006 at 10:26 AM.
kakemot.com
Submit your games or applications to kakemot.com!
-
Oct 29th, 2006, 10:28 AM
#10
Lively Member
Re: [RESOLVED] Pressing enter instead of clicking...
Forgot to add...
the form KeyPreview propoerty must be set to True.
Matt
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|