Пример #1
0
        private void mnuSua_Click(object sender, EventArgs e)
        {
            if (tvPhongHoc.SelectedNode == null)
            {
                return;
            }
            frmTuyChon frm = new frmTuyChon();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                tvPhongHoc.SelectedNode.Text = frm.txtGiaTri.Text;
            }
        }
Пример #2
0
        private void mnuThem_Click(object sender, EventArgs e)
        {
            frmTuyChon frm = new frmTuyChon();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                if (tvPhongHoc.SelectedNode == null)
                {
                    TreeNode root = new TreeNode(frm.txtGiaTri.Text);
                    tvPhongHoc.Nodes.Add(root);
                }
                else
                {
                    TreeNode node = new TreeNode(frm.txtGiaTri.Text);
                    tvPhongHoc.SelectedNode.Nodes.Add(node);
                }
            }
        }