Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 1.33 KB

tree-control-item-selection.md

File metadata and controls

17 lines (13 loc) · 1.33 KB
description title ms.date helpviewer_keywords ms.assetid
Learn more about: Tree Control Item Selection
Tree Control Item Selection
11/04/2016
tree controls [MFC], item selection
controls [MFC], selecting items in
CTreeCtrl class [MFC], item selection
item selection in tree controls
7bcb3b16-b9c8-4c06-9350-7bc3c1c5009b

Tree Control Item Selection

When the selection changes from one item to another, a tree control (CTreeCtrl) sends TVN_SELCHANGING and TVN_SELCHANGED notification messages. Both notifications include a value that specifies whether the change is the result of a mouse click or a keystroke. The notifications also include information about the item that is gaining the selection and the item that is losing the selection. You can use this information to set item attributes that depend on the selection state of the item. Returning TRUE in response to TVN_SELCHANGING prevents the selection from changing; returning FALSE allows the change.

An application can change the selection by calling the SelectItem member function.

See also

Using CTreeCtrl
Controls