### Customized TableView with CheckBoxes

A solution for building a TableView with one column which is a CheckBox with Text.
`Sub Process_Globals
...
Private tvChecklist As TableView
...
End Sub`
'Build the TableView with 10 CheckBoxes
`Sub FillTable
For i=1 To 10
Dim cbItem As CheckBox
cbItem.Initialize("")
cbItem.Text = "Item " & i
cbItem.Checked=False
cbItem.Tag = i
tvChecklist.Items.Add(Array As Object(cbItem))
Next
tvChecklist.SetColumnWidth(0, tvChecklist.PrefWidth - 4)
End Sub`
'A button with lists the CheckBoxes selected
'Note that the table has only one column which is assigned to a CheckBox
`Sub btnListSelected_Action
For Each tvo() As Object In tvChecklist.Items
Dim cb As CheckBox = tvo(0)
If cb.checked Then Log($"Selected ${cb.Text}"$)
Next
End Sub`
Note
The selected items can also be added to a list, like
Public Selected As List
Selected.Initialize
`Sub btnListSelected_Action
For Each tvo() As Object In tvChecklist.Items
Dim cb As CheckBox = tvo(0)
If cb.checked Then Selected.Add(cb.Text)
Next
frm.Close
End Sub`

Changed: , Category: TableView, File: T6C259M1879.htm, ID: 1879