Navigation:  ThinBASIC Modules > UI (User Interface) > Additional Controls and Functions > TreeView Control >

TreeView_InsertItem

Previous pageReturn to chapter overviewNext page

 

Description

 

Insert a new data item into a TreeView control.

 

Syntax

 

hItem = TreeView_InsertItem(hWnd, ctrlID, hParent, hAfter, Image, ImageSel, sText [, SetBold])

 

 

Returns

 

Number

If the operation is successful, the handle to the new data item is returned.

If the operation fails, the value zero is returned.

 

Parameters

 

Name

Type

Optional

Meaning

hWnd

Number

No

Handle of the dialog containing the list-view control

ctrlID

Number

No

Control identifier assigned to the control during CONTROL ADD ...

hParent

Number


Specifies the parent of this item, or zero if item is to be inserted at the root

hAfter

Number


Specifies the handle of the item after which this new item is to be inserted.

Use the following equates for special positions:

%TVI_FIRST to insert new item at the beginning

%TVI_LAST to insert new item at the end

%TVI_SORT to insert new item in alphabetical order

Image

Number

Number

If an ImageList has been attached to the control, this parameters specify which image should be displayed (1=first, 2=second, etc.) for normal items.

 

If no image is needed, the value(s) 0 should be used.

But if an ImageList is connected to the TreeView control 0 (zero) will in any case load first image of the ImageList. In this case, load as first image of the ImageList an empty image

ImageSel

Number

Number

If an ImageList has been attached to the control, this parameters specify which image should be used for selected items.

 

If no image is needed, the value(s) 0 should be used.

But if an ImageList is connected to the TreeView control 0 (zero) will in any case load first image of the ImageList. In this case, load as first image of the ImageList an empty image

sText

String

No

The text string to insert into the control

SetBold

Number

Yes

If %TRUE, than items text is set to bold

 

 

Remarks

 

Restrictions

 

See also

 

Examples