WinXAddTreeView


hTreeView = WinXAddTreeView (parent, hImages, editable, draggable, id)

Creates a new tree view control and adds it to a window

Parameter Description
parent The handle to the window to add the tree view control to
hImages The handle to the image list containing the images for the tree view control, 0 if there are no images
editable $$TRUE if the user can edit the labels, $$FALSE otherwise
draggable $$TRUE if the user can drag items, $$FALSE otherwise
id The unique id constant for this control

Returns

The handle to the new tree view control or 0 on fail

Remarks

To implement label edit you need to provide and register an onLabelEdit callback. To implement dragging you need to provide and register te onDrag callback.

The hImages parameter is a handle to an image list control. See the Win32 documentation for more information on image lists.

Examples

'define the id
$$ID_TREE = 100

'first, make an image list
hIml = ImageList_Create (16, 16, $$ILC_COLOR32|$$ILC_MASK, 3, 0)
'add a bitmap
ImageList_AddMasked (hIml, LoadImageA (0, &"images.bmp", $$IMAGE_BITMAP, 0, 0, $$LR_LOADFROMFILE), 0x00FF00FF)

'now create the tree view control
hTV = WinXAddTreeView (#hMain, hIml, $$FALSE, $$FALSE, $$ID_TREE)

Related Links

WinXTreeView_AddItem
WinXTreeView_DeleteItem
WinXTreeView_GetSelection
WinXTreeView_CopyItem
onDrag (Callback)
onLabelEdit (Callback)