Specifying Default and Cancel buttons

Default command button

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:

NoteOther 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.

Cancel command button

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.

NoteDefault 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.