I have a simple form with a couple of data entry fields and a 'Submit' button. I've successfully gotten the 'Submit' button to show as the default but after entering the data into the fields I press the 'Enter' key and the button's events aren't executed.
Is there something else I need to do? I was thinking maybe it had to do with the tab order but changing that didn't help either.
I'll promise to be appropriately embarassed with the answer if you promise not to laugh (too loudly anyway) ...
The default button style is just that, a visual style (at least it is without taking additional steps in the message retrieval loop). If you used a modal dialog (Windows only) then the default button would indeed behave in the way you expect. For windows (as opposed to dialogs), however, you generally have to trap the return key yourself. Do a search for IsDialogMessage_() for further discussions of this type of thing.
I may look like a mule, but I'm not a complete ass.
The standard for a window is the space key!
Only on Dialogwindows you use the enterkey. You have to integrate this by yourself
(see AddKeyboardshortcut)