Handling the Tap-and-Hold Event

Because a Pocket PC device does not have a mouse, users cannot right-click a control. Instead, they must tap the control with the stylus and then hold the stylus in place until the context-sensitive menu is displayed. To provide context-sensitive menus for your controls, you use the ContextMenu control. The ContextMenu control is described in Chapter 3.

If you want to provide functionality other than a context-sensitive menu to the tap-and-hold action on a control, you must trap the action manually. You should create a timer control on your form and set its interval to the amount of time you want the user to hold the stylus for before triggering your function. Capture the MouseDown event to start the timer and the ...

Get Microsoft® .NET Compact Framework (Core Reference) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.