Modifying Tree-View Item Appearance (Windows CE 5.0)
Every tree-view item has a current state that determines its appearance and functionality. You can retrieve and set this state by sending the TVM_GETITEM and TVM_SETITEM messages, or by using the TreeView_GetItem and TreeView_SetItem macros. You set or retrieve the item state by using the state member of the TV_ITEM structure that you pass to these messages and macros in the pItem or lParam parameter of the macro or message.
Windows CE supports the TVIS_EXPANDPARTIAL item state. This state indicates that a tree-view item is expanded partially. This can happen if an error occurs during data retrieval and some of the child items cannot be retrieved from the data source. The tree view displays the items that were retrieved successfully, but the tree view continues to display a plus (+)next to the parent item, too. The plus (+)indicates to a user that more information is available. When a user clicks the plus (+) again, the application repeats the query.
The following table shows item states that are supported by Windows CE.
|TVIS_BOLD||Windows CE uses a bold font to draw the item.|
|TVIS_CUT||Windows CE selects the item for cutting and pasting.|
|TVIS_DROPHILITED||Windows CE selects the item for a drag-and-drop operation.|
|TVIS_EXPANDED||Windows CE expands the item's list of child items, so that the child items are visible. This state applies only to parent items.|
|TVIS_EXPANDEDONCE||Windows CE expands the item's list of child items at least once. Windows CE does not send the TVN_ITEMEXPANDING and TVN_ITEMEXPANDED messages for parent items that have specified this value. This value applies only to parent items.|
|TVIS_EXPANDPARTIAL||Windows CE partially expands the items. This could happen if an error occurs during data retrieval and some of the child items cannot be retrieved from the data source.|
|TVIS_FOCUSED||Windows CE gives the item the focus and surrounds it with a standard focus rectangle. Although more than one item can be selected, only one item can have the focus.|
|TVIS_OVERLAYMASK||Windows CE includes the overlay image of the item when it draws the image. The index of the overlay image must be specified in the state member of the TV_ITEM structure by using the INDEXTOOVERLAYMASK macro. The overlay image must be added to the image list of the tree view by using the ImageList_SetOverlayImage function. This value should not be combined with any other value.|
|TVIS_SELECTED||Windows CE selects the item. The appearance of a selected item depends on whether it has the focus and whether the system colors are used for selection.|
|TVIS_STATEIMAGEMASK||Windows CE includes the state image of the item when it draws the item. The index of the state image must be specified in the state member of the TV_ITEM structure by using the INDEXTOSTATEIMAGEMASK macro. This value should not be combined with any other value.|
Send Feedback on this topic to the authors