How to: Handle HardwareButton Events (Devices)
Use a HardwareButton control to override the application keys on a Pocket PC.
To assign a HardwareButton component to a specific application key
From the Device Components tab of the Toolbox, drag a HardwareButton component onto a Windows Form or into the Component tray in the designer.
In the Component tray, right-click the HardwareButton control, and then on the shortcut menu, click Properties.
Set the AssociatedControl property to the form, for example, Form1.
Set the HardwareKey property to the key you want to override, for example, ApplicationKey1.
Click the button, for example, Soft Key 1, on the designer's skin.
The Code Editor opens at the Form_KeyDown event handler.
Insert the following code:
if ((int) e.KeyCode == (int) Microsoft.WindowsCE.Forms.HardwareKeys.ApplicationKey1) { //TODO }
You would typically use the //TODO section to launch an application.
See Also
Tasks
How to: Use the HardwareButton Component
Concepts
Creating and Developing Managed Device Projects