Apologies - I know this one is my lack of understanding - but have tried to follow other examples and am missing something.
I have a panel containing labels - when clicked the text from the label is used with SQL to generate a list.
For each item in the list I would like to place an image in an adjacent panel.
for the images I am looking to use a dynamic array of images (dependant on how many items are in the list)
my code is as follows - the label click, sql elements work fine - but my understanding of image arrays is sadly lacking :BangHead:
any help appreciated. thanks
I have a panel containing labels - when clicked the text from the label is used with SQL to generate a list.
For each item in the list I would like to place an image in an adjacent panel.
for the images I am looking to use a dynamic array of images (dependant on how many items are in the list)
my code is as follows - the label click, sql elements work fine - but my understanding of image arrays is sadly lacking :BangHead:
any help appreciated. thanks
B4X:
Sub lbl_click
Dim lb As Label
Dim tnode As node
Dim testa As String
Dim testb As String
Dim cursor1 As Cursor
Dim l As Int
Dim t As Int
Dim c As Int
l = 0
t = 5
lb = Sender
tnode = lb.Tag
testa = tnode.tag
testb = lb.Text
Dim datam As String
cursor1=sql1.ExecQuery2("select Section from Sections where Manual =?",Array As String(testb))
c = cursor1.RowCount
Dim imageview2(c) As ImageView
For i = 0 To cursor1.RowCount -1
cursor1.Position = i
datam = cursor1.GetString("Section")
l = l +5
Panel2.AddView(imageview2(c),l+5,t,25,25)
imageview2(i).tag = i
Next
End Sub