Sub Populate_ScrollView()
Dim ScrollView1 As ScrollView
Dim lstChecks As List
Dim height As Int : height = 50dip
Dim pnl As Panel
ScrollView1.Initialize(0)
pnl = ScrollView1.Panel
Activity.AddView(ScrollView1, 0, 0, 100%x, 100%y)
lstChecks.Initialize
nbIndex = 0
For i = 1 To MsgNb
Dim chk As CheckBox
chk.Initialize("chkchng")
hSubjectItem = hSubjectList.Get(nbIndex) 'get the item
chk.Text = hSubjectItem
chk.tag = i
lstChecks.Add(chk)
Dim lbl1 As Label
lbl1.Initialize("")
hFromItem = hFromList.Get(nbIndex) 'get the item
lbl1.Text = hFromItem
lbl1.Gravity = Gravity.CENTER_VERTICAL
pnl.AddView(chk, 0, height * (i - 1), 120dip, height)
pnl.AddView(lbl1, 125dip, height * (i - 1), 120dip, height)
nbIndex = nbIndex + 1
Next
pnl.height = lstChecks.Size * height
End Sub