Pocket PC Platform Behavior
It is important to be aware of platform-specific behavior when developing applications for Pocket PCs, especially when creating forms.
To prevent confusion and a cluttered appearance, the .NET Compact Framework displays forms to occupy the entire screen of 240x320 pixels. Forms cannot be resized or repositioned.
The Pocket PC taskbar is at the bottom of the screen, and used by all applications to display menu selections and to show and hide the InputPanel Component. When the user switches to a different application or form, the taskbar always shows the menu associated with the currently active form. The .NET Compact Framework hides the taskbar if the active form does not have a menu associated; therefore, the main form is created with an associated menu to prevent the taskbar from being hidden.
Note
On Windows CE, the main application form is not initially created with a menu. If one is added, it is positioned at the top of the form.
Controls and Core Elements
The following table lists how controls and other elements operate and appear on the Pocket PC. For more information about controls, see Controls in the .NET Compact Framework.
Note
Values greater than a 16-bit signed integer are not supported on a Pocket PC.
Control or Element |
Behavior |
---|---|
BackColor for container controls |
The BackColor for a Form, Panel, and TabPage is the Window system color. |
Buttons to minimize and close programs |
If ControlBox = true, the form displays the OK button in the upper-right corner which closes the form. If ControlBox = true and Minimize = true, the form displays the smart minimize X button in the upper-right corner which runs the program in the background. If ControlBox = false, the form does not display OK or X buttons. |
Desktop |
Screen without the menu bar. |
Property decreases when a menu bar is added to a form. |
|
Property cannot be set unless FormBorderStyle = None |
|
Property cannot be unless FormBorderStye = None |
|
Maximize Box |
Setting to true or false has no affect. Maximize always has no affect because Pocket PC applications are run at full size. |
Menus |
Applications include a menu on the main form, by default, with all form menus positioned at the bottom of the display. |
Menu Bar and Toolbar (These controls are combined and can display both menu items and toolbar buttons.) |
Retains a fixed position at the bottom of the screen. The location cannot be changed, as it is owned by the system. |
Menu separator on the Main Menu |
A menu separator is included on the Main Menu. |
MessageBoxIcon enumeration |
Supports the Asterisk, Exclamation, Hand, None, and Question enumerations. |
Navigation Bar |
This bar is the top portion of a Pocket PC application that contains the Start button, the title of the application, and the OK and X (smart minimize) buttons. |
If you do not specify a file name extension, Pocket PC appends the extension of the selected type in the dialog box. |
|
Smart Minimize Button (X) |
Sets the application to run in the background but does not close it. |
Tab Control |
Location is always anchored at 0,0 and stretches to fit the width of its container. |
FormBorderStyle
The following table describes window characteristics on the Pocket PC.
FormBorderStyle |
Behavior |
---|---|
Fixed3D |
Same as FixedSingle. |
FixedDialog |
Same as FixedSingle. |
FixedSingle |
Window occupies the entire desktop and cannot be moved or resized. |
FixedToolWindow |
Same as FixedSingle. |
None |
Window is movable and resizable. Window is borderless with no window caption. |
Sizable |
Same as FixedSingle. |
SizableToolWindow |
Same as FixedSingle. |
FormWindowState
The following table describes window states on the Pocket PC.
FormWindowState |
Behavior |
---|---|
Maximized |
If no menu bar, window occupies entire screen. |
Normal |
Window occupies the entire desktop. |
Shortcuts
To have an icon saved in the Pocket PC Start Menu Most Recently Used (MRU) List, create a shortcut to your application somewhere under \Windows\Start Menu\Programs. When your application is launched from this shortcut an icon for your applications will appear the MRU list.
Display Shortcut Menus from a Hardware Button
You can configure a hardware button on a Pocket PC to display a shortcut menu, implemented by the ContextMenu control, with a Form or control in your application. You can associate one or more shortcut menus with hardware buttons, such as in the following scenario:
A Form associated with contextmenu1 displayed with hardware button 1.
A Panel associated with contextmenu2 displayed with hardware button 2.
A Button associated with contextmenu3 displayed with hardware button 3.
To associate a hardware button with a shortcut menu
Develop your application to have shortcut menus using the ContextMenu control.
On the Pocket PC, tap Start, Settings, Personal, and then Buttons.
Select a button and assign it to a shortcut menu.
If a control with a shortcut menu has the focus, then pressing the associated hardware button displays its shortcut menu.
This feature is not available in Pocket PC 2002 and earlier versions.