Delphi, VirtualStringTree - classes (objects) instead of records

前端 未结 4 1017
-上瘾入骨i
-上瘾入骨i 2020-12-30 16:39

I need to use a class instead of record for VirtualStringTree node.

Should I declare it standard (but in this case - tricky) way like that:

PNode = ^         


        
4条回答
  •  轮回少年
    2020-12-30 17:13

    you could create the object instance after receiving the node data, as in :

    fNd:= vstTree.getNodeData(vstTree.AddChild(nil)); 
    fnd.obj := TMbyObject.Create;
    

    or you could try and assign it directly

    Pointer(Obj) := vstTree.getNodeData(...);

提交回复
热议问题