Metodos de mi clase :
Código Delphi
[-]
function TCuentasContables.DevuelveSaldoCuenta: Double;
begin
if CuentaImputable then
Result := SaldoCuenta
Else
Result := Result + DevuelveSaldoCuentasHijas ;
end;
Código Delphi
[-]
function TCuentasContables.DevuelveSaldoCuentasHijas: Double;
var
I : Integer;
begin
if not Assigned(CuentasHijas) then
Begin
Result :=0;
Exit;
End;
for I := 0 to CuentasHijas.Count-1 do
Result := Result +TCuentasContables(CuentasHijas.Items[i]).DevuelveSaldoCuenta ;
end;
Luego desde el form para mostrar en el arbol:
Código Delphi
[-]
for N :=1 to tvArbol.Items.Count -1 do
tvArbol.Items [N].Text := tvArbol.Items [N].Text +' ( '+ FormatFloat ('$0.00', TCuentasContables (tvArbol.Items [N].Data ).DevuelveSaldoCuenta )+' )';
Gracias a todos.
Mision Cumplida!!!