求一拉TREE控件,不知道哪们仁兄有. 就是一combobox点击下拉TREE出来.谢谢..

解决方案 »

  1.   

    http://download.microsoft.com/download/2/9/0/290e3bc2-a238-447f-ad45-98e590b3048b/TreeViewControl.msi
    可否?
      

  2.   

    楼上兄弟,那是1.1的.我可不想再同时安装1.1Framework,有2.0的不?
      

  3.   

    http://blog.csdn.net/wzuomin/archive/2007/06/14/1652464.aspx
      

  4.   

    lz可以直接使用我的那个ComboBoxTree.dll文件,
    可惜我也不怎么会改成c#的代码。
    http://download.csdn.net/source/357943
      

  5.   

    如果只需要点击出现一个TreeView,是不是就如
    http://blog.csdn.net/zhzuo/archive/2005/12/04/543278.aspx
    http://p.blog.csdn.net/images/p_blog_csdn_net/zhzuo/161762/o_image004.jpg
    上面的实现是使用一个TreeView来隐藏和显示来实现效果。
    主要代码如下,
    //设置目录选择框的位置
    this.treeViewCategory.Location = new Point(this.comboBoxCategory.Location.X,this.comboBoxCategory.Location.Y + this.comboBoxCategory.Size.Height);
    this.treeViewCategory.Size = new Size(this.comboBoxCategory.Size.Width,this.treeViewCategory.Height);事件处理程序,
    private void comboBoxCategory_DropDown(object sender, System.EventArgs e)
    {

    this.treeViewCategory.Select();
    this.comboBoxCategory.DropDown -= new System.EventHandler(this.comboBoxCategory_DropDown);
    this.comboBoxCategory.DroppedDown = true;
    this.comboBoxCategory.DropDown += new System.EventHandler(this.comboBoxCategory_DropDown);
    //if( this.treeViewCategory.Visible == true )
    //{
    // return;//在显示TreeView的情况下
    //}
    this.treeViewCategory.Visible = !this.treeViewCategory.Visible;


    }
      

  6.   

    不是递归么    private void TypeBind()
        {
            ListItem items = new ListItem();
            items.Text = "无";
            items.Value ="-1";
            this.DropDownList1.Items.Add(items);
            //得到所有设备名称:
            DataSet ds = SqlHelper.ExecuteDataset(connstr, CommandType.Text,
                "select ID,Name,PID from SDTZ_EquipmentType");        dt = ds.Tables[0];        //第一层加载(ID为-1)
            DataRow[] drs = dt.Select("PID=-1");
            for (int i = 0; i < drs.Length; i++)
            {
                string name = drs[i][1].ToString();
                int id = Convert.ToInt32(drs[i][0]);            this.DropDownList1.Items.Add(name);
                this.DropDownList1.Items[this.DropDownList1.Items.Count - 1].Value = id.ToString();
                j = 0;
                LoadTree(id);
            }
        }
        int j = 0;
        //递归函数:
        private void LoadTree(int typeid)
        {
            string test = "";
            DataRow[] drs = dt.Select("PID=" + typeid + "");        if (drs != null)
            {
                j++;
                for (int i = 0; i < j; i++)
                {
                    test = test + "|-";
                }
                for (int i = 0; i < drs.Length; i++)
                {
                    this.DropDownList1.Items.Add(test + drs[i][1].ToString());
                    this.DropDownList1.Items[this.DropDownList1.Items.Count - 1].Value = drs[i][0].ToString();                LoadTree(Convert.ToInt32(drs[i][0]));
                }
            }
        }