当前位置:首页 > 网络编程 > 软件语言 > .NET > TreeView [ 回车展开节点, 鼠标右键,禁止闪屏....]

TreeView [ 回车展开节点, 鼠标右键,禁止闪屏....]

点击次数:72 次 发布日期:2008-11-06 08:13:02 作者:源代码网
源代码网推荐
广告载入中

源代码网整理以下using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace ksClient
{
    public partial class DGM : Form
    {
        //获取当前选定的节点值
        public int CurrentVal = 0;

源代码网整理以下        //获取控件树的深度
        public int pubDeep = 0;

源代码网整理以下        // 获取子树节点的个数
        public int pubChildNum = 0;
              
        //获取当前节点对象
        public TreeNode CurrentNode = null;

源代码网整理以下        //设置 对话框
        public DialogResult dr; 软件开发网 www.mscto.com

源代码网整理以下        public DataSet ds1 = null;
        public DataSet ds2 = null;
        public DataSet ds3 = null;
        public DataSet ds4 = null;
     
        public DGM()
        {
            InitializeComponent();
        }

源代码网整理以下        private DataSet  Bind(string sql)
        {
            SqlConnection conn = new SqlConnection("Server=.;database=model;Integrated Security=SSPI");
            SqlDataAdapter da = new SqlDataAdapter(sql,conn);
            DataSet ds = new DataSet();
            da.Fill(ds);
            return ds;
           
        }
        private void KK(string sql)
        {
            SqlConnection conn = new SqlConnection("Server=.;database=model;Integrated Security=SSPI");


            SqlCommand cmd = new SqlCommand(sql, conn);
            try
            {
                conn.Open();
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected  void inittree()
        {
            tvShow.Nodes.Clear();

源代码网整理以下
            DataView dv = Bind("select *from series").Tables[0].DefaultView;
           
            ds1 = Bind("select * from groups");
            ds2 = Bind("select *from subject");
            ds3 = Bind("select * from chapter");
            ds4 = ds3.Copy();
          //  ds4 = Bind("select * from chapter");

源代码网整理以下            if (dv.Table.Rows.Count > 0)
            {
                foreach (DataRowView dr in dv)


源代码网推荐

源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华