|
『原创』C#中TreeView类操作全攻略:建立树,新增节点,删除节点,修改节点,拖动节点,与Oracle数据库交互操作(一)(24) this.txt_Tag.Text=editForm.NewFuncItem.funcTag; this.txt_Name.Text=editForm.NewFuncItem.funcName; this.txt_Detail.Text=editForm.NewFuncItem.funcDetail; this.txt_BelongTo.Text=editForm.NewFuncItem.funcBelongTo; ; this.cbo_Type.SelectedValue=editForm.NewFuncItem.funcType; this.txt_FunEntity.Text=editForm.NewFuncItem.funcEntity; if (editForm.NewFuncItem.funcIsInterface =="0") { this.ckb_IsInterface.Checked=false; } else { this.ckb_IsInterface.Checked=true; } } trv_Function.Focus(); } else { MessageBox.Show("没有选中要修改的节点!","警告",MessageBoxButtons.OK,MessageBoxIcon.Warning); } } private void btn_Remove_Click(object sender, System.EventArgs e) { if(trv_Function.SelectedNode!= null) { if (ClientMessageBox.showConfirm("你确定要删除这些数据吗?", "功能维护")== DialogResult.Yes) //if (MessageBox.Show ("你确定要删除这些数据吗?", "删除数据", //MessageBoxButtons.YesNo, MessageBoxIcon.Question)== DialogResult.Yes) { TreeNode nextFocusNode=new TreeNode(); //如果选中的是根节点(根据路径名是否等于节点名判断,两者相等的话则表示是根节点 if(trv_Function.SelectedNode.FullPath==trv_Function.SelectedNode.Text)
|