Clicking on an ImgView in a scrollview panel

thughesimsuk

Member
Licensed User
Longtime User
Firstly I am not sure if this is a bug or not and I apologise in advance if its my lack of knowledge. I have a scrollview and I have added images to the scrollview panel,

img_blank_yes.Initialize("ImgView")
img_blank_yes.Bitmap = LoadBitmap(File.DirAssets, "yes_blank.png")
img_blank_yes.BringToFront
ScrollView1.Panel.AddView(img_blank_yes, 475, 51, 47dip, 50dip)

I have a sub called img_blank_yes_Click, but on the click event of the image nothing happens, what I want to do is change the image on the click event. I added a button to the scroll panel and that seemed to be ok so is this a bug with images?

Thankyou
 

klaus

Expert
Licensed User
Longtime User
You should either use this :
B4X:
img_blank_yes.Initialize("img_blank_yes") 
'
Sub img_blank_yes_Click
    Msgbox("Clicked","TEST")
End Sub
or this :
B4X:
img_blank_yes.Initialize("ImgView") 
'
Sub ImgView_Click
    Msgbox("Clicked","TEST")
End Sub
The text in the Initialize keyword is the generic Event name.

Best regards.
 

thughesimsuk

Member
Licensed User
Longtime User
Thankyou

Erel, Klaus Thankyou! :)



You should either use this :
B4X:
img_blank_yes.Initialize("img_blank_yes") 
'
Sub img_blank_yes_Click
    Msgbox("Clicked","TEST")
End Sub
or this :
B4X:
img_blank_yes.Initialize("ImgView") 
'
Sub ImgView_Click
    Msgbox("Clicked","TEST")
End Sub
The text in the Initialize keyword is the generic Event name.

Best regards.
 
Top