using 'Type' with imageview.tag

harlechguy

Member
Licensed User
Longtime User
Hi all, is it possible to use either a 'Type' variable with an imageview.tag.

I have created a type

'Type thumbimage(thumba as string, indexa as int)'

I can pass the thumbimage data to my tag but cannot see how to reference just the thumbimage.indexa variable

- my current script is as follows but this only allows the passing of one variable.
sub setupthumb
thumb(i).Tag = folderb
end sub

sub clickthumb
tc = Sender
clickedthumb = tc.Tag
end sub

many thanks
 

klaus

Expert
Licensed User
Longtime User
You should post some more code so we can see exactly what you hade done.

When you set a Tag you need to Dim for each Tag a new thumbimage Type variable.
B4X:
Dim tmb as thumbimage
tmb.thumba = something
tmb.indexa = somethingelse
thumb(i).Tag = tmb
and
B4X:
Sub thumb_Click
  Dim img as ImageView   
  Dim tmb as thumbimage
  img = Sender
  tmb = img.Tag
  clickedthumb = tmb.thumba
End Sub
Best regards.
 
Upvote 0
Top