C#中 treeview控件中点击展开那个小加号,同时就能选中展开的这个节点,怎么编辑代码??

RT 求高手解决!!
2024-11-18 11:46:08
推荐回答(1个)
回答1:

///


/// 展开节点后发生
///

///
///
private void treeView1_AfterExpand(object sender, TreeViewEventArgs e)
{
treeView1.SelectedNode = e.Node;
}

///
/// 折叠节点后发生
///

///
///
private void treeView1_AfterCollapse(object sender, TreeViewEventArgs e)
{
treeView1.SelectedNode = e.Node;
}