B boy_zyz Unregistered / Unconfirmed GUEST, unregistred user! 2000-10-16 #2 笨办法 sum:=0; tmp:=TreeView1.Items[0]; while tmp<>nil do begin if tmp.Level =0 then inc(sum); tmp :=tmp.GetNext ; end;
笨办法 sum:=0; tmp:=TreeView1.Items[0]; while tmp<>nil do begin if tmp.Level =0 then inc(sum); tmp :=tmp.GetNext ; end;
F FreeFly Unregistered / Unconfirmed GUEST, unregistred user! 2000-10-16 #3 procedure TForm1.Button1Click(Sender: TObject); var i,total :Integer; begin total := 0; for i:=0 to tv.Items.Count-1 do begin if tv.Items.level=0 then //0 is level you want total := total + 1; end; showmessage(inttostr(total)); end;
procedure TForm1.Button1Click(Sender: TObject); var i,total :Integer; begin total := 0; for i:=0 to tv.Items.Count-1 do begin if tv.Items.level=0 then //0 is level you want total := total + 1; end; showmessage(inttostr(total)); end;