Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make a button the "default" on a form 2

Status
Not open for further replies.

RLMuller

Programmer
Mar 7, 2003
15
0
0
US
When I add buttons to a dialog in VC++, I can designate one as the default which will receive a click message when Return is pressed on any control.

Where's its counterpart in C# forms?
 
There's a property on the form called "AcceptButton". Set it to the button you want to be the default.

You can also assign a button to the "CancelButton" property, which does what you might expect ;-)

Chip H.
 
Chip,

Thanks for your help. You were right on the mark, of course.

Regards,
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top