title | description | ms.assetid | keywords | topic_type | api_name | api_location | api_type | ms.topic | ms.date | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
TVM_EXPAND message (Commctrl.h) |
The TVM\_EXPAND message expands or collapses the list of child items associated with the specified parent item, if any. You can send this message explicitly or by using the TreeView\_Expand macro. |
d6c2e5b2-ce36-4c2b-b527-91c6de56e305 |
|
|
|
|
|
reference |
05/31/2018 |
The TVM_EXPAND message expands or collapses the list of child items associated with the specified parent item, if any. You can send this message explicitly or by using the TreeView_Expand macro.
-
wParam
-
Action flag. This parameter can be one or more of the following values:
Value Meaning - TVE_COLLAPSE
Collapses the list. - TVE_COLLAPSERESET
Collapses the list and removes the child items. The TVIS_EXPANDEDONCE state flag is reset. This flag must be used with the TVE_COLLAPSE flag. - TVE_EXPAND
Expands the list. - TVE_EXPANDPARTIAL
Version 4.70. Partially expands the list. In this state the child items are visible and the parent item's plus sign (+), indicating that it can be expanded, is displayed. This flag must be used in combination with the TVE_EXPAND flag. - TVE_TOGGLE
Collapses the list if it is expanded or expands it if it is collapsed. -
lParam
-
Handle to the parent item to expand or collapse.
Returns nonzero if the operation was successful, or zero otherwise.
Expanding a node that is already expanded is considered a successful operation and SendMessage returns a nonzero value. Collapsing a node returns zero if the node is already collapsed; otherwise it returns nonzero. Attempting to expand or collapse a node that has no children is considered a failure and SendMessage returns zero.
When an item is first expanded by a TVM_EXPAND message, the action generates TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notification codes and the item's TVIS_EXPANDEDONCE state flag is set. As long as this state flag remains set, subsequent TVM_EXPAND messages do not generate TVN_ITEMEXPANDING or TVN_ITEMEXPANDED notifications. To reset the TVIS_EXPANDEDONCE state flag, you must send a TVM_EXPAND message with the TVE_COLLAPSE and TVE_COLLAPSERESET flags set. Attempting to explicitly set TVIS_EXPANDEDONCE will result in unpredictable behavior.
The expand operation may fail if the owner of the treeview control denies the operation in response to a TVN_ITEMEXPANDING notification.
Requirement | Value |
---|---|
Minimum supported client |
Windows Vista [desktop apps only] |
Minimum supported server |
Windows Server 2003 [desktop apps only] |
Header |
|