我用shelltreeview怎样回到原来的root的状态啊?
即分支全部收起来。

解决方案 »

  1.   

    laihecongxi(兴哥,thanks但我还用了shelllistview,怎样也将这个控件回到最初状态?
    即显示root下面的文件夹。
      

  2.   

    shelltreeview有无可以实现回到特定的目录?
      

  3.   

    shelltreeview.FullCollapse;
    这样只能显示到最上目录,我想显示最上目录下一级的内容!!!
      

  4.   

    shelllistview没有试,你自己摸索一下~ :-)NodeLevel为你要显示到的级数 root为0,以次类推。
    按你的要求应该用CustomCollapse(1);procedure CustomCollapse(NodeLevel:integer);
    var
      Node: TTreeNode;
    begin
      Node := Treeview1.Items.GetFirstNode;
      while Node <> nil do
      begin
        if Node.Level = NodeLevel then
        Node.Collapse(True);
        Node := Node.GetNext;
      end;
    end;
      

  5.   

    shelllistview,怎样也将这个控件回到最初状态?
    即显示root下面的文件夹。
    HELP!!!!!!!!
      

  6.   

    看来还要帮一把了。:-)
    放一个ShellComboBox1上去。如果你不让它显示的话可以放在shelllistview后面
    ,然后设置ShellComboBox1的ShellListView属性为 yourShellListView
    然后通过控制ShellComboBox1的itemindex来实现。procedure buttonClick;
    begin
       ShellComboBox1.itemindex:=0;
    end;