469,338 Members | 8,424 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,338 developers. It's quick & easy.

Setting a default button?

Is there a way to set a button that will execute if the user hits
<enter>?

Thanks,
Brett

Feb 23 '06 #1
3 23231
Brett,

see Form.AcceptButton
there's also a Form.CancelButton

-SLC

Feb 23 '06 #2
The Form has an AcceptButton property that you can assign the default
Button.

--
Tim Wilson
..NET Compact Framework MVP

"Brett Romero" <ac*****@cygen.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Is there a way to set a button that will execute if the user hits
<enter>?

Thanks,
Brett

Feb 23 '06 #3
Assuming that you are talking about a Windows Form, then set the AcceptButton
property on the form (not on the button).

Setting the CancelButton property will set a button that executes when
pressing the Esc key.

HTH,
pagates

"Brett Romero" wrote:
Is there a way to set a button that will execute if the user hits
<enter>?

Thanks,
Brett

Feb 23 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jeff Cope | last post: by
3 posts views Thread by Xarky | last post: by
3 posts views Thread by Brian Henry | last post: by
3 posts views Thread by Marty McFly | last post: by
1 post views Thread by andyrich_1 | last post: by
reply views Thread by Glenn | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
1 post views Thread by haryvincent176 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.