Windows Forms and Graphics
This .NET Compact Framework version 2.0 provides expanded user interface capabilities with the following features:
More .NET Compact Framework–specific controls in the Microsoft.WindowsCE.Forms namespace.
Expanded support for controls and classes in the System.Windows.Forms namespace.
Greater drawing and graphics support.
Auto-scrollable forms.
Clipboard support.
Keyboard events.
Pocket PC–specific features.
Smartphone-specific features.
Improved shutdown of Windows Forms applications and object destruction.
Support for integrated keyboards on the Pocket PC.
Support for changes in screen orientation and resolution. See How to: Handle Orientation and Resolution Changes.
New and Changed Types in Microsoft.WindowsCE.Forms
The following table summarizes the new classes and other changes in the Microsoft.WindowsCE.Forms namespace. For a list of controls that you can use, see Windows Forms Controls in the .NET Compact Framework.
Type |
Description |
---|---|
Displays and responds to user notifications. |
|
Displays and manages documents. |
|
Provides override capabilities for buttons on the Pocket PC hardware. |
|
Provides access to all input method software installed on a Pocket PC. |
|
Supported on Smartphone 2003. |
|
Defines a logical font object for text effects such as angled text. |
|
Provides the new Text property. You can use this property to set and get the text of a MessageWindow. |
|
Provides the Hibernate event, which allows you to free cached resources as warranted. |
|
Allows you to change the screen orientation value to 90, 180, or 270 without resetting the device. Requires Pocket PCs running Windows Mobile 2003 Second Edition. |
Windows Forms Support
The following table summarizes the expanded support in the .NET Compact Framework 2.0 for classes in the System.Windows.Forms namespace.
Control or feature |
Expanded support |
---|---|
Support includes copying and pasting a DataObject. |
|
Support for the DropDownStyle property. |
|
Version 2.0 supports the following members:
|
|
See How to: Use the DateTimePicker Class in the .NET Compact Framework. |
|
Design time experience |
Docking, anchoring, and Splitter are supported. |
Font collection |
Supported. |
Supported on common controls. |
|
Form control |
Support for the following members: Better performance with full-screen forms. |
Form.Load event |
The form is made visible after the Form.Load event occurs. This may affect applications that perform custom drawing or show another form during the event. |
This class is supported along with the Help events and event-handler classes. For an example, see How to: Display User Help. The HelpProvider class, however, is not supported. |
|
Key events |
Supported on common controls. |
KeyPreview property |
Supported on common controls. You can use the KeyPreview property to trap keyboard events from integrated keyboards. |
Supported, but only provides a basic hyperlink, which is automatically formatted as underlined and blue. |
|
The EnsureVisible method is supported. |
|
Menus and tool bars |
The command bar of a child window in a Pocket PC application is brought to the top of the z-order when it is added. This causes the command bar to hide any lower z-order controls that overlap the command bar client area. |
Supported. |
|
Owned modal dialogs |
Supported. |
Supported. |
|
Supported. |
|
Supported. |
|
Tabbing and focus |
The .NET Compact Framework version 2.0 supports the TabIndexandTabStop properties, but does not support the UpdateZOrdermethod. In version 2.0, you are no longer required to explicitly set the first control to receive the focus. If a form contains a control that can be tabbed, the control gets focus when the form is displayed. This matches the full .NET Framework behavior and aids keyboard navigation. Setting the Focus property returns true only if the focus was successfully set to the new control. If the target control is disabled, or if the focus is removed from the target control in a GotFocus event or in a LostFocus event, the Focus method returns false. Tabbing occurs among controls that are children to a custom control. |
There are no behavior restrictions, and you can control the width. By default, the control is docked to the top to maintain version 1.0 behavior. |
|
The following is supported:
|
|
Threading |
A NotSupportedException is thrown when a control is accessed from a thread other than the one it was created on without using the Invoke method. |
Button tooltips are supported. |
|
Removing tick marks is supported. |
|
The following members are supported:
Selecting an item with the ENTER key is supported. |
|
Supported. |
|
Full support requires Windows Mobile Version 5.0 for Pocket PCs and Smartphones. For more information, see How to: Use the WebBrowser Control in the .NET Compact Framework. |
Graphics Support
The .NET Compact Framework 2.0 has expanded support for drawing and using graphic objects with the following features:
Saving an image with the Image.Save(String, ImageFormat) method.
Bitmap data access with the LockBits(Rectangle, ImageLockMode, PixelFormat) method. See How to: Use LockBits.
Bitmap serialization (including JPG).
ClearType font support.
Creating text effects using LogFont objects. For a sample application, see Rotated Text Using LogFont Sample.
Patterned brushes (built-in and bitmap).
Cloning a Pen, setting its width, and using the dash style.
DirectX and Direct3D
The .NET Compact Framework 2.0 provides classes for developing mobile applications using managed DirectX and Direct3D classes. However, running the applications requires Windows Mobile version 5.0 software for Pocket PC and Windows Mobile version 5.0 for Smartphone. For more information and How-to topics, see Mobile Direct3D Programming in the .NET Compact Framework.
Pocket PC Features
The .NET Compact Framework 2.0 provides the following features for the Pocket PC:
Associating a hardware button with an application by using the HardwareButton component.
Associating a hardware button with a shortcut menu.
The DocumentList control.
Sending a Notification.
Using the InputPanel.InputMethodCollection collection.
For more information, see Pocket PC Development and the .NET Compact Framework.
Smartphone Features
The .NET Compact Framework 2.0 provides the following expanded support for the Smartphone:
The DataGrid class.
Setting the alpha or numeric input mode for text boxes. See How to: Set Smartphone Input Modes.
QVGA legacy applications.
For more information, see Smartphone Development and the .NET Compact Framework.
Improved Shutdown
Closing applications has improved in two ways:
The Dispose method is called in all cases when a control is destroyed, providing for a better shutdown.
When the main form is closed, the .NET Compact Framework destroys windows in a top-down manner.
See Also
Concepts
.NET Framework Support and New Features
Reference
Supported Classes in the .NET Compact Framework