Compartir a través de


Provide a Hierarchical Display of Items Sample

File: ...\Samples\Solution\OLE\Outline.scx

This sample shows two different types of ActiveX controls, which you can use for outlining. In this sample, a directory structure is displayed. A custom method on the form named FillTree is called recursively to iterate through the entire tree structure.

The Treeview control also allows display of images with each node.

Treeview Control

The Treeview control can give your applications a truly genuine Windows look. Unlike the Outline control, which uses methods and item indexes, the Treeview control uses a Nodes collection.

Note

To display images in a treeview control, you must add an ImageList control to the form.

* Add items to treeview control
o = THIS.PageFrame1.Page2.oleTreeview
IF cnt = 1
   oNode = o.nodes.add(,1,LOWER(m.path)+"_",LOWER(m.path),,)
   oNode.Image = "world"   &&name of image
ELSE
   oNode = o.nodes.add(m.pkey,4,LOWER(m.path)+"_",LOWER(m.path),,)
   oNode.Image = "fldr"   &&name of image
ENDIF

See Also

Tasks

Treeview/Listbox Drag and Drop Sample

Solution Samples

Reference

Visual FoxPro Foundation Classes A-Z

Other Resources

ActiveX Solution Samples