Einzelnen Beitrag anzeigen

Hawkeye219

Registriert seit: 18. Feb 2006
Ort: Stolberg
2.227 Beiträge
 
Delphi 2010 Professional
 
#10

Re: VirtualStringTree Node anhand des Index ermitteln

  Alt 22. Okt 2009, 15:12
Hallo,

hier ist mein Versuch:

Delphi-Quellcode:
function GetAbsoluteNode (aTree: TBaseVirtualTree; aIndex: Cardinal): PVirtualNode;
begin
  Result := aTree.GetFirst;
  while (Assigned(Result) and (aIndex > 0)) do
    if (aIndex >= Result.TotalCount) then
      begin
        Dec (aIndex, Result.TotalCount);
        Result := aTree.GetNextSibling(Result);
      end
    else
      begin
        Dec (aIndex);
        Result := aTree.GetFirstChild(Result);
      end;
end;
Gruß Hawkeye
  Mit Zitat antworten Zitat