lundi 2 mars 2015

C# Winforms Default Button

I'm working on a form that has two main buttons, "OK" and "Cancel". I have set the "Accept Button" property of the form to be the "OK" button.


Goal: I would like the "OK" button to be default, so that when the form is opened the "OK" button is highlighted and initiates if the enter key is pressed.


Problem: When the form loads, the "Cancel" button is highlighted, until the user clicks anywhere in the form, then the "OK" button becomes highlighted.


Any suggestions?


Aucun commentaire:

Enregistrer un commentaire