You can specify that a CommandButton is the default button in a window by selecting Default in the General properties page in the button's Properties view.
When there is a default CommandButton and the user presses the Enter key:
If the focus is not on another CommandButton, the default button's Clicked event is triggered
If the focus is on another CommandButton, the Clicked event of the button with focus is triggered
Other controls affect default behavior
If the window does not contain an editable field, use the SetFocus function
or the tab order setting to make sure the default button behaves
as described above.
A bold border is placed around the default CommandButton.
You can define a CommandButton as the cancel button by selecting Cancel in the General properties page in the button's Properties view. If you define a cancel CommandButton, the cancel button’s Clicked event is triggered when the user presses the Esc key.
Default and cancel actions in Windows CE applications
Because it is usually easier to click a command button with
the stylus than to use the SIP or peripheral keyboard, it is not
standard practice in Windows CE applications to use the Enter and
Esc keys for default and cancel actions. There is no Esc key on
the Smartphone, but you can use the Action key for the Enter key.