Adding Nodes to MS TreeView (MSCOMCTL.ocx)

dayv2005

Member
I was wanting to mess around with treeviews and other objects in the mscomctl.ocx. I initialized the ctrlframe and that's about it. I was wondering if anyone could show me or point me into the right direction with adding nodes and grouping them and images and so forth.
 

dayv2005

Member
I figured out you can add nodes like this

chNode:Nodes:ADD(,,,"Node1").

I figured out how to add child nodes

just a little more info on images and what not.

Anyone know how i can do that?


chNode:Nodes:ADD(,,"root","Root").
chNode:Nodes:ADD("root", 4, "c1", "Child 1").
 

FrancoisL

Member
You need to add a ImageList control in your window and set it to (16x16).

TreeView:ImageList = <Your Image List>.

Put your icons and image inside the list .

Then in the add insert the position of the images:

TreeView:Add(parent, type, key, desc, <1>, <2> ).

<1> = INT Representing the position of your image inside the list for the unselected image.

<2> = INT Representing the position of your image inside the list for the Selected image.
 

dayv2005

Member
You need to add a ImageList control in your window and set it to (16x16).

TreeView:ImageList = <Your Image List>.

Put your icons and image inside the list .

Then in the add insert the position of the images:

TreeView:Add(parent, type, key, desc, <1>, <2> ).

<1> = INT Representing the position of your image inside the list for the unselected image.

<2> = INT Representing the position of your image inside the list for the Selected image.

TreeView:ImageList = <Your Image List>. can i set that in the OCX properties of my tree view, set it to the control of im imagelist?

also how add pictures to the image list?

you wouldn't happen to have a snippet of htis would you
?
 

FrancoisL

Member
No you can't set it up in the OCX Propreties because your tree view OCX doesn't see your Image List OCX . Progress creates a control-frame for each of them. You really need to get the com-handle of the Image List to assign it.

I always add images using the custom property of the OCX properties of the ImageList.

Code:
chTreeView = chTreeView:TreeView.
chImageList = chImageList:ImageList.

chTreeView:ImageList = chImageList.

/* add a close folder image and a open image folder in position 1 and 2 respectively. */

chTreeView:ADD(,,"Root","Root",1,2).
 

dayv2005

Member
No you can't set it up in the OCX Propreties because your tree view OCX doesn't see your Image List OCX . Progress creates a control-frame for each of them. You really need to get the com-handle of the Image List to assign it.

I always add images using the custom property of the OCX properties of the ImageList.

Code:
chTreeView = chTreeView:TreeView.
chImageList = chImageList:ImageList.

chTreeView:ImageList = chImageList.

/* add a close folder image and a open image folder in position 1 and 2 respectively. */

chTreeView:ADD(,,"Root","Root",1,2).

thank you very much
 
Top