var NextNode:TTreeNode; ChildCount:Integer; begin ChildCount:=0; if tv_DBServer.Items.Count>0 then begin NextNode:=tv_DBServer.Items[0]; While Assigned(NextNode) do begin inc(ChildCount); NextNode:=NextNode.getNextSibling; end; end; end;
var i, k: integer; begin k := 0; for i := 0 to TreeView1.Items.count - 1 do begin if TreeView1.Items.Item[i].HasChildren then inc(k); end; showmessage(inttostr(k)); end;
procedure TForm1.Button2Click(Sender: TObject); var bytCount:byte; begin bytCount:=tree.Items.Item[0].Count; edit5.Text:=inttostr(bytCount); end;
NextNode:TTreeNode;
ChildCount:Integer;
begin
ChildCount:=0;
if tv_DBServer.Items.Count>0 then
begin
NextNode:=tv_DBServer.Items[0];
While Assigned(NextNode) do
begin
inc(ChildCount);
NextNode:=NextNode.getNextSibling;
end;
end;
end;
i, k: integer;
begin
k := 0;
for i := 0 to TreeView1.Items.count - 1 do
begin
if TreeView1.Items.Item[i].HasChildren then
inc(k);
end;
showmessage(inttostr(k));
end;
var
bytCount:byte;
begin
bytCount:=tree.Items.Item[0].Count;
edit5.Text:=inttostr(bytCount);
end;
|_第一
|_第一一
|_第一一一
|_第二即使第二无后,他的辈分还是该有的呵呵