tufanv Expert Licensed User Longtime User Jul 4, 2015 #1 Hello When i use dim img(16) as imageview I cant use for example sub img(4)_click. it gives error : You cant use something ( i dont remember the exact word) in first line. So how am i supposed to use click event for each imageview ? TY
Hello When i use dim img(16) as imageview I cant use for example sub img(4)_click. it gives error : You cant use something ( i dont remember the exact word) in first line. So how am i supposed to use click event for each imageview ? TY
sonicmayne Member Licensed User Longtime User Jul 4, 2015 #2 You can get the Sender from the sub. For example: Code: Copy Sub img_Click Dim imgview As ImageView = Sender If imgview = img(4) Then 'Do stuff End If End Sub Remember to initialize each ImageView first. Upvote 0
You can get the Sender from the sub. For example: Code: Copy Sub img_Click Dim imgview As ImageView = Sender If imgview = img(4) Then 'Do stuff End If End Sub Remember to initialize each ImageView first.
tufanv Expert Licensed User Longtime User Jul 4, 2015 #4 sonicmayne said: You can get the Sender from the sub. For example: Code: Copy Sub img_Click Dim imgview As ImageView = Sender If imgview = img(4) Then 'Do stuff End If End Sub Remember to initialize each ImageView first. Click to expand... I tried it now as I itialized all of them ) Sub img_Click Dim imgview As ImageView = Sender If imgview = img(0) Then Log("circle1") End If End Sub but i cant see anything at logs altough i clicked on the first circle . Am i missing stg here ? Upvote 0
sonicmayne said: You can get the Sender from the sub. For example: Code: Copy Sub img_Click Dim imgview As ImageView = Sender If imgview = img(4) Then 'Do stuff End If End Sub Remember to initialize each ImageView first. Click to expand... I tried it now as I itialized all of them ) Sub img_Click Dim imgview As ImageView = Sender If imgview = img(0) Then Log("circle1") End If End Sub but i cant see anything at logs altough i clicked on the first circle . Am i missing stg here ?
sonicmayne Member Licensed User Longtime User Jul 4, 2015 #5 Is the event name for each set to img? For example: Code: Copy img(0).Initialize("img") Upvote 0
klaus Expert Licensed User Longtime User Jul 4, 2015 #6 You should post your whole code how you declare, initialize and add the ImageViews, without seeing what exactly you have done it's impossible to give a concrete advice. Otherwise we must try to guess what you could have done wrong and this is not efficient. Upvote 0
You should post your whole code how you declare, initialize and add the ImageViews, without seeing what exactly you have done it's impossible to give a concrete advice. Otherwise we must try to guess what you could have done wrong and this is not efficient.
tufanv Expert Licensed User Longtime User Jul 4, 2015 #7 Yeah that was the problem. I initailiaized all the views with the same event name and it is now working . Thanks sonicmayne said: Is the event name for each set to img? For example: Code: Copy img(0).Initialize("img") Click to expand... Upvote 0
Yeah that was the problem. I initailiaized all the views with the same event name and it is now working . Thanks sonicmayne said: Is the event name for each set to img? For example: Code: Copy img(0).Initialize("img") Click to expand...
Ohanian Active Member Licensed User Longtime User Jul 4, 2015 #8 Hi, you should do something like this : Code: Copy img(0).Initialize("img") img(0).tag = 0 then : Code: Copy Dim imgview As ImageView = Sender If imgview.tag = 0 Then Log("circle1") End If Upvote 0
Hi, you should do something like this : Code: Copy img(0).Initialize("img") img(0).tag = 0 then : Code: Copy Dim imgview As ImageView = Sender If imgview.tag = 0 Then Log("circle1") End If