Пример #1
0
 private void treeView_DoubleClick(object sender, EventArgs e)
 {
     TreeNode tn = treeView.SelectedNode;
     tTableDiffcult db = new tTableDiffcult();
     DataTable dt = db.Select(Convert.ToInt32(tn.Tag));
     MessageBox.Show(string.Format("节点名称:{0}\r\n节点层级:{1}\r\n节点备注:{2}\r\n",
         dt.Rows[0]["fName"], dt.Rows[0]["fid"].ToString().Length / 2 - 1, dt.Rows[0]["fRemark"]));
     treeView.ExpandAll();
 }
Пример #2
0
        public FormDetail(TreeNode tn, string op)
        {
            InitializeComponent();

            this.tn = tn;
            this.op = op;
            if (op.Equals("Add"))
            {
            }
            else if (op.Equals("Edit"))
            {
                tTableDiffcult db = new tTableDiffcult();
                DataTable dt = db.Select(Convert.ToInt32(tn.Tag));
                btnOK.Text = "修改";
                txtBox_fName.Text = dt.Rows[0]["fName"].ToString();
                txtBox_fRemark.Text = dt.Rows[0]["fRemark"].ToString();
            }
        }