In this
CLV solution the CustomListView item consists of a checkbox and a label.
The order of the views in the designer (or when adding by code) determines the index number of the GetView method.
Each item of a CLV has a default panel even if it's not present in the designer or when you use the AddTextItem method.
This code shows how to use the properties of the checkbox and the label:
Private Sub clv1_ItemClick (Index As Int, Value As Object)
If clv1.GetPanel(Index).GetView(0).Checked = False Then
clv1.GetPanel(Index).GetView(0).Checked = True ' change the property Checked
Log(clv1.GetPanel(Index).GetView(1).Text) ' the value of the label text
End If
End Sub
You can of course only use the properties that are available for that view type: a checkbox has a Checked property, a label has a Text property.
The Value parameter contains the value that was used to add an item to the CLV as in:
For i = 0 To 4
Dim pnl As Pane = set_clv1_item("clvitem_layout",i,names.Get(i))
clv1.Add(pnl,i)
Next
In this case the Value parameter is equal to the index of the item in the CLV (0 to 4).
This explanation is of course for a CustomListView.
And for the not recommended use of a ListView (and stated by
@teddybear):
ListView1.AddTwoLines2("text 1","text 2","text 2")
Private Sub ListView1_ItemClick (Position As Int, Value As Object)
Log(Position)
Log(Value)
Log(ListView1.GetItem(Position)) ' return value set to the second line
End Sub