Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Feb : Re: TTreeNode.Data
| Subject: | Re: TTreeNode.Data |
| Posted by: | "Alexander" (al..@mail.ru) |
| Date: | Wed, 16 Feb 2005 10:02:14 |
Exactly for me :)
Thanks
"Bas van Beek" <bas-no@spam-please.nl> ???????/???????? ? ????????
?????????: news:421201d9$1@newsgroups.borland.com...
> Jeremy Collins wrote:
>> Jeremy Collins wrote:
>>
>>> Alexander wrote:
>>>
>>>> How I can assign any data to TTreeNode.Data and Retrive it to back?
>>>> Thanks
>>>
>>>
>>>
>>> type
>>> PMyRec = ^TMyRec;
>>> TMyRec = record
>>> SomeInt : integer;
>>> SomeBool : boolean;
>>> SomeStr : string[20];
>>> end;
>>>
>>> Assigning a data record to a node:
>>>
>>> var
>>> ANode : TTreeNode;
>>> PData : PMyRec;
>>> begin
>>> ANode := TreeView1.Items.Add(nil, 'Some Node');
>>> New(PData);
>>
>>
>> You probably want to populate the data here, of course.
>>
>
> The example shown is using a record. You can also use
> objects. The data property can hold a pointer, ANY pointer.
none