Adding the New Button

Team-Fly    

 
eMbedded Visual Basic: Windows CE and Pocket PC Mobile Applications
By Chris Tacke, Timothy Bassett
Table of Contents
Chapter 4.  Working with Menu Controls for Pocket PC


The New button is a common element to Pocket PC applications. It's found in applications such as Contacts, Calendar, Inbox, Tasks , Pocket Excel, and Pocket Word. The intention of this button is to trigger an event that allows the application to create a new instance of the document/record currently displayed. The button is made present or absent from the menu bar via the MenuBar.NewButton property. It's set to True by default and is read-only at runtime.

You can use a setting in the device's Control Panel to enable the new button menu. To enable this setting, from the Start menu choose Control Panel, Settings, and then Menus. On the New Menu tab, select Turn On New Button Menu. If this setting is checked, there will be a combobox-style arrow on the right of the application's New button. When this combobox arrow is tapped, the new button expands into a menu that offers each item registered on the device for New, as shown in Figure 4.12. Each item on the New menu is registered on the device to receive this event and provide a prompt. This registration takes place via a DLL and can't be directly accomplished in eVB.

Figure 4.12. The New button, when tapped on the arrow, displays a menu item for each item registered on the device.

graphics/04fig12.gif

If the New button is included in an application, be aware that if the user selects a "new" document/record from a different application, your application will become inactive.

Note

Pocket PC keeps these tasks in memory. Pocket PC keeps only one instance of the application running, so when the application is requested , it's simply brought to the front. This is different behavior than Palm-Sized PC (Windows CE 2.x), especially for eVB. Using eVB for Palm-Sized PC, you had to manually intervene using API calls to prevent the device from opening multiple instances of the application.


The response to the New button when tapped is simple. The third and last event on the MenuBar control is NewClick. No parameters are passed as there can be only one New button on a MenuBar control.


Team-Fly    
Top
 


eMbedded Visual BasicR. WindowsR CE and Pocket PC Mobile Applications
eMbedded Visual BasicR. WindowsR CE and Pocket PC Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2001
Pages: 108

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net