ListView_InsertData

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > UI (User Interface) > CONTROLS > Control Types > ListView Control > Listview Control Commands > ListView: General functions >

ListView_InsertData

 

Description

 

Add new items and set items properties taking data from a string array or string matrix.

 

Syntax

 

n = ListView_InsertData(hWnd, ctrlID, StringArrayOrMatrix [, RowStart [, HowManyRows]])

 

Returns

 

Number.

Number of rows added

 

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 ...

StringArrayOrMatrix

Variable

No

A string array (one dimension) or a string matrix (two dimensions)

RowStart

Number

Yes

If present, it can be used to specify from which row of the array/matrix to start to keep data. If not present or less than 1, 1 will be assumed.

HowManyRows

Number

Yes

If present, it can be used to limit the number of rows to consider starting from RowStart position.

 

Remarks

 

Programmer does not need to worry about RowStart/HowManyRows usage exceed array/matrix boundaries. thinBasic will automatically detect it.

 

Restrictions

 

See also

 

Examples

 

'...

'---Assign data to 2 dimension matrix

Dim s(5, 3) As String

 s(1,1) = "Folder 1""1""Whatever data here regarding Folder 1"

 s(2,1) = "Folder 2""2""Whatever data here regarding Folder 2"

 s(3,1) = "Folder 3""3""Whatever data here regarding Folder 3"

 s(4,1) = "Folder 4""4""Whatever data here regarding Folder 4"

 s(5,1) = "Folder 5""5""Whatever data here regarding Folder 5"

 

'---ListView columns must be already in place

'---Add full matrix data to listview

LISTVIEW_InsertData hDlg, %ID_LV_LEFT, s()

'...