This documentation is archived and is not being maintained.

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-handling 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.


A Text property was added.


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.

New Text Property for MessageWindow

You can use the new Text property to set and get text of a MessageWindow.

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


ForeColor and BackColor properties

Supported on common controls.

Form control

Support for the following members:

Better performance with full-screen forms.

System.Windows.Forms.Form.Load event

The form is made visible after the System.Windows.Forms.Form.Load event occurs. This may affect applications that perform custom drawing or show another form during the event.


This 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 for trapping Key events from integrated keyboards.


Supported, but only provides a basic hyperlink 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.



Owned modal dialogs








Tabbing and focus

The .NET Compact Framework version 2.0 supports the TabIndex and TabStop properties, but does not support the UpdateZOrder method. 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 only returns true 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:


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.




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:

DirectX and Direct3D

The .NET Compact Framework 2.0 provides classes for developing mobile application using managed DirectX and Direct3D classes. To run the applications, however, 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.

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 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:

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