Sub populate_questions
Dim Cursor1 As Cursor
Cursor1 = SQL1.ExecQuery("SELECT * FROM FireSafety")
For i = 0 To Cursor1.RowCount -1
img1.Initialize("ImgView")
Cursor1.Position = i
img1.Bitmap = LoadBitmap(File.DirAssets, "audit_template_new.png")
ScrollView1.Panel.AddView(img1, 40dip, img_height, 728dip, 115dip)
'QuestionRef
lbl_questionref.Initialize("Label")
lbl_questionref.Text = Cursor1.GetString("QuestionNr")
lbl_questionref.TextColor = Colors.Black
ScrollView1.Panel.AddView(lbl_questionref, 50dip, img_height+10dip, 350dip, 40dip)
'Question Content
lbl_question.Initialize("Label")
lbl_question.Text = Cursor1.GetString("Question")
lbl_question.TextColor = Colors.DarkGray
ScrollView1.Panel.AddView(lbl_question, 50dip, img_height+40dip, 380dip, 70dip)
'Image Blank
img_blank_yes.Initialize("YES")
img_blank_yes.Bitmap = LoadBitmap(File.DirAssets, "yes_blank.png")
img_blank_yes.BringToFront
img_blank_yes.Tag = i
ScrollView1.Panel.AddView(img_blank_yes, 475dip, img_height+31dip, 47dip, 50dip)
'Add 115 to add to the TOP value
img_height = img_height + 115dip
Next
Cursor1.Close
ScrollView1.Panel.Height = img_height
End Sub
Sub YES_Click
Msgbox(img_blank_yes.Tag,"Image")
end sub