A anndy1999 Unregistered / Unconfirmed GUEST, unregistred user! 2008-04-18 #1 比如我的treeview 的节点深度为5级, 我只想展开treeview 中的0级和1级节点,如何做呢? 谢谢
D DIGUA Unregistered / Unconfirmed GUEST, unregistred user! 2008-04-18 #2 procedure TForm1.Button1Click(Sender: TObject); var node:TTreeNode; i:Integer; begin for i:=0 to tv.Items.Count-1do begin if (tv.Items.Item.Level=1) or (tv.Items.Item.Level=0) then begin tv.Items.Expanded:=true; end; end; end;
procedure TForm1.Button1Click(Sender: TObject); var node:TTreeNode; i:Integer; begin for i:=0 to tv.Items.Count-1do begin if (tv.Items.Item.Level=1) or (tv.Items.Item.Level=0) then begin tv.Items.Expanded:=true; end; end; end;
K kaida Unregistered / Unconfirmed GUEST, unregistred user! 2008-04-18 #3 for I := 0 to TreeView1.Items.Count-1do if TreeView1.Items.Level < 2 then TreeView1.Items.Expand(false);
for I := 0 to TreeView1.Items.Count-1do if TreeView1.Items.Level < 2 then TreeView1.Items.Expand(false);