You are right, this will not work, because the link says
root.SelectAction = TreeNodeSelectAction.Expand;
Instead, write // use .Select
root.SelectAction = TreeNodeSelectAction.Select;
He will work.
TreeNodeSelectAction.Expand Toggles the node between expanded and collapsed. Raises the TreeNodeExpanded event or the TreeNodeCollapsed event, as appropriate. TreeNodeSelectAction.None Raises no events when a node is selected. TreeNodeSelectAction.Select Raises the SelectedNodeChanged event when a node is selected. TreeNodeSelectAction.SelectExpand Raises both the SelectedNodeChanged and TreeNodeExpanded events when a node is selected. Nodes are only expanded, never collapsed.
source share