Hi.
I want to find out which checkbox has had is checked state changed. This is from the example here: http://www.b4x.com/forum/basic4andr...7221-list-two-columns-checkbox.html#post41354
The example shows how to go through the whole list and find out which checkboxes are checked. I want to find out which checkbox checked state has changed as soon as it is clicked:
Sub Process_Globals
End Sub
Sub Globals
Dim ScrollView1 As ScrollView
Dim lstChecks As List
Dim height As Int
height = 50dip
Dim chk As CheckBox
End Sub
Sub Activity_Create(FirstTime As Boolean)
ScrollView1.Initialize(0)
Dim pnl As Panel
pnl = ScrollView1.Panel
Activity.AddView(ScrollView1, 0, 0, 100%x, 100%y)
lstChecks.Initialize
For i = 1 To 10
chk.Initialize("chkchng")
chk.Text = "Item #" & i
chk.tag = i
lstChecks.Add(chk)
Dim lbl1 As Label
pnl.AddView(chk, 0, height * (i - 1), 120dip, height)
Next
pnl.Height = lstChecks.Size * height
End Sub
Sub Chkchng_CheckedChange(Checked As Boolean)
'show which checkbox has been clicked
End Sub
I want to find out which checkbox has had is checked state changed. This is from the example here: http://www.b4x.com/forum/basic4andr...7221-list-two-columns-checkbox.html#post41354
The example shows how to go through the whole list and find out which checkboxes are checked. I want to find out which checkbox checked state has changed as soon as it is clicked:
Sub Process_Globals
End Sub
Sub Globals
Dim ScrollView1 As ScrollView
Dim lstChecks As List
Dim height As Int
height = 50dip
Dim chk As CheckBox
End Sub
Sub Activity_Create(FirstTime As Boolean)
ScrollView1.Initialize(0)
Dim pnl As Panel
pnl = ScrollView1.Panel
Activity.AddView(ScrollView1, 0, 0, 100%x, 100%y)
lstChecks.Initialize
For i = 1 To 10
chk.Initialize("chkchng")
chk.Text = "Item #" & i
chk.tag = i
lstChecks.Add(chk)
Dim lbl1 As Label
pnl.AddView(chk, 0, height * (i - 1), 120dip, height)
Next
pnl.Height = lstChecks.Size * height
End Sub
Sub Chkchng_CheckedChange(Checked As Boolean)
'show which checkbox has been clicked
End Sub