/// <summary> /// 选中树节点后发生的事件 /// 将当前选中节点中的控件对象设置为选中状态 /// </summary> /// <param Name="sender"></param> /// <param Name="e"></param> void SVObjTreeView_AfterSelect(object sender, TreeViewEventArgs e) { ObjTreeNode node = e.Node as ObjTreeNode; if (node == null) { return; } SVPanel panel = node.objControl as SVPanel; if (panel == null) { return; } panel.Selected = true; panel.Refresh(); }
/// <summary> /// 单击树节点事件 /// 清空当前选中节点对象的选中状态 /// </summary> /// <param Name="sender"></param> /// <param Name="e"></param> void SVObjTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { ObjTreeNode node = this.SelectedNode as ObjTreeNode; if (node == null) { return; } SVPanel panel = node.objControl as SVPanel; if (panel == null) { return; } panel.Selected = false; panel.Refresh(); }