A More Powerful ListView
|Figure 4. Update ListView Control: The ListView control is significantly improved, adding features including individual ListViewItem tooltips and owner-draw support.|
control is already very flexible. It supports multiple views, including LargeIcon
, and the ability to automatically add checkboxes to items in the Items
collection. Several missing features are being added to both the ListView
classes. You can control how each individual item within the ListView is drawn by setting the OwnerDraw
property to True
and then handle the DrawItem
event of the ListView.
If you want to specify item-specific tooltips, you can set the ShowItemToolTips
property to True
and set individual ToolTipText
values for each instance of a ListViewItem that you add to the Items collection. Both techniques are shown in Figure 4
There is a new grouping feature using the ListViewGroup class that allows ListViewItems within a ListView class to be grouped according to custom settings and visually associated with each other when the View property of the ListView class is set to any value other than List. ListView groups are available only on Windows XP and Windows Server 2003.
Active Document Editing
You'll use the new ActiveDocumentHost class to display and edit in-place assorted active documents directly from your Windows application. Examples of active documents include rich text-format files and Office documents. You will use the ActiveDocumentHost class to load documents initially in static read-only mode.
|Figure 5. The ActiveDocumentHost Class: This class simplifies viewing and editing active documents.|
class provides some very powerful features. You can set the DrawMode
property to Normal
, or Zoom
to control the display mode when the document is inactive. You can set the ActivationGesture
property to Click
, or Never
to control which action switches the document to edit mode. You can use the ShowMenus
properties to modify the look of the document when active and you can set the Tooltarget
property to the object that houses the toolbars when the document is active.
As shown in Figure 5
, all the toolbars, menu bars, and appropriate editing elements of the original application are hosted in the Windows application, and the document itself becomes editable. The originating application must be installed on the local computer in order to host a document within an instance of the ActiveDocumentHost class