|
-
May 27th, 1999, 09:27 AM
#1
CTreeCtrl : message TVN_ITEMEXPANDING not always send
Why, when I use the Expand function of a CTreeCtrl, the Tree control don't send TVN_ITEMEXPANDING and TVN_ITEMEXPANDED messages ? When I let the control open and collapse the node (by clicking), the notyfication are correctly send.
How to always send the notyfication message when I use de Expand function ?
-
May 27th, 1999, 10:51 AM
#2
Re: CTreeCtrl : message TVN_ITEMEXPANDING not always send
This is pretty standard behaviour.
Also, if you change selection in something using a message (not via user input) you generally dont get a sel change message.
You will have to send the messages yourself (or simply call your handlers for the messages).
m_tree.Expand(....);
OnTreeExpand(....);
-
May 27th, 1999, 10:59 AM
#3
Re: CTreeCtrl : message TVN_ITEMEXPANDING not always send
Yes, but in MFC documentation, It's says that the message TVN_ITEMEXPANDING and TVN_ITEMEXPANDED are send when the TreeCtrl send TVM_EXPAND
This is the MFC documentation :
TVM_EXPAND
wParam = (WPARAM) (UINT) flag;
lParam = (LPARAM) (HTREEITEM) hItem;
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.
Returns nonzero if a change took place, or zero otherwise.
flag
Action flag. This parameter can be one or more of the following values: TVE_COLLAPSE Collapses the list.
TVE_COLLAPSERESET Collapses the list and removes the child items. 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 symbol 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.
hItem
Handle to the parent item to expand or collapse.
The TVM_EXPAND message will cause the TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notification messages to be generated if the item being expanded does not have the TVIS_EXPANDEDONCE state bit set. This state gets set when a parent item is expanded for the first time. Using TVE_COLLAPSE and TVE_COLLAPSERESET with TVM_EXPAND will cause the TVIS_EXPANDEDONCE state to be reset.
If the item already has the TVIS_EXPANDEDONCE state set, the TVM_EXPAND message will not cause the TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notification messages to be generated.
--------------------------------------------------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|