Deselect Event for TreeView
-
Wednesday, February 18, 2009 8:00 PMIs there a way to tell when an item in a tree view has been deselected or otherwise if the treeview has lost focus?
There is the "Leave" event, but the problem I have is my treeview is part of a UserControl that is embeded in a dock bar I'm adding to an exsisting program. The controls in the UserControl seem to retain their focus status regardless of the focus status of the dockbar or usercontrol.
Eric
All Replies
-
Wednesday, February 18, 2009 11:31 PM
The TreeView.AfterSelect documentation contains a clue that might help you:
http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.afterselect.aspx
[quote]
This event does not occur when the node is unselected. To detect this occurrence, handle the Control.MouseUp event and test the TreeNode.IsSelected property.
[/quote]- Proposed As Answer by Harry ZhuModerator Friday, February 20, 2009 6:06 AM
- Marked As Answer by Harry ZhuModerator Tuesday, February 24, 2009 1:48 AM

