By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,682 Members | 1,980 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,682 IT Pros & Developers. It's quick & easy.

Form and Enter

P: n/a
Hsg
Hi all..

in C# , and specally in Forms ...
i had creat a form , the user enter Inputs , and then
press the Button ...

is there a way that the user will have teh choice to
press the Button on the form , or just simply Press the
Enter Button in his Key Bord ..?

thanks ..

Nov 15 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

Set the AcceptButton property on the form to the button you want to use when
the user presses Enter; there is also a CancelButton property for the ESC
key.

---
Steven Wood
"Hsg" <hs***@yahoo.com> wrote in message
news:34****************************@phx.gbl...
Hi all..

in C# , and specally in Forms ...
i had creat a form , the user enter Inputs , and then
press the Button ...

is there a way that the user will have teh choice to
press the Button on the form , or just simply Press the
Enter Button in his Key Bord ..?

thanks ..

Nov 15 '05 #2

P: n/a
Hsg
Thank you Mr. Steven for your replay ...
but can you show me a simple sample code ...

becouze i wont to give the user teh choice either to
press the Form button , or press the Keyboed "Enter Key"

-----Original Message-----

Set the AcceptButton property on the form to the button you want to use whenthe user presses Enter; there is also a CancelButton property for the ESCkey.

---
Steven Wood
"Hsg" <hs***@yahoo.com> wrote in message
news:34****************************@phx.gbl...
Hi all..

in C# , and specally in Forms ...
i had creat a form , the user enter Inputs , and then
press the Button ...

is there a way that the user will have teh choice to
press the Button on the form , or just simply Press the
Enter Button in his Key Bord ..?

thanks ..

.

Nov 15 '05 #3

P: n/a
No code is required.

Create a new form, put a button on it called button1. Click on the form in
the designer and press F4 to bring up the properties. The AcceptButton
property will display a drop down list; simply select button1 from the list.
Now, when the app runs the user can click on button1 using the mouse or
press the Enter key. Either of these actions will fire the button1_click
event.

---
Steven Wood

"Hsg" <hs***@yahoo.com> wrote in message
news:2e****************************@phx.gbl...
Thank you Mr. Steven for your replay ...
but can you show me a simple sample code ...

becouze i wont to give the user teh choice either to
press the Form button , or press the Keyboed "Enter Key"

-----Original Message-----

Set the AcceptButton property on the form to the button

you want to use when
the user presses Enter; there is also a CancelButton

property for the ESC
key.

---
Steven Wood
"Hsg" <hs***@yahoo.com> wrote in message
news:34****************************@phx.gbl...
Hi all..

in C# , and specally in Forms ...
i had creat a form , the user enter Inputs , and then
press the Button ...

is there a way that the user will have teh choice to
press the Button on the form , or just simply Press the
Enter Button in his Key Bord ..?

thanks ..

.

Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.