Select the product you need help with
How To Know When the User Clicks a Check Box in a TreeView ControlArticle ID: 261289 - View products that this article applies to. This article was previously published under Q261289 SUMMARY
On a TreeView control with the TVS_CHECKBOXES style, there is no notification that the checked state of the item has been changed. There is also no notification that indicates that the state of the item has changed. However, you can determine that the user has clicked the state icon of the item and act upon that.
MORE INFORMATION
When the user clicks the check box of a TreeView item, an NM_CLICK notification is sent to the parent window. When this occurs, the TVM_HITTEST message returns TVHT_ONITEMSTATEICON. The TreeView control uses this same condition to toggle the state of the check box. Unfortunately, the TreeView control toggles the state after the NM_CLICK notification is sent. You can post a user-defined message to the same window that is processing the NM_CLICK notification, and treat this user-defined message as a notification that the checked state has changed. Following is sample code that illustrates how this can be accomplished: PropertiesArticle ID: 261289 - Last Review: July 11, 2005 - Revision: 1.3
|


Back to the top








