Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When ever I click on any one of the images the eventsender returns nothing so I can't use the specific button that is clicked.
It works on the other almost 1000 forms we have.

Private Sub imgOption_Click(ByVal eventSender As System.Object, ByVal eventArgs As EventArgs) Handles _imgOption_0.Click, _imgOption_1.Click, _imgOption_2.Click, _imgOption_3.Click, _imgOption_4.Click, _imgOption_5.Click, _imgOption_6.Click, _imgOption_7.Click, _imgOption_8.Click

Any advice ?
Posted
Comments
CHill60 30-Jul-14 7:57am    
Check that you *have* actually named the button as one of the names listed after Handles and that the case is correct. Did you add these buttons programmatically or at design time?
Asgard25 30-Jul-14 7:59am    
Design Time, and yes I have double checked the names.
Asgard25 30-Jul-14 8:00am    
And if I click any one of the images click event it goes to the sub. Even in debug it goes to the right sub and executes all the code except where I need the eventsender details.
CHill60 31-Jul-14 8:30am    
Didn't see your responses because you didn't use the Reply link :-)
Can you post the line where you are trying to use the eventSender details?
Asgard25 31-Jul-14 8:56am    
Haha sorry :-)
Dim index As Integer = Array.IndexOf(imgOption, eventSender)

1 solution

Fixed it by deleting the entire form and coded everything from scratch.
Don't have the time so spend days or even hours to fix it.
 
Share this answer
 
Comments
CHill60 31-Jul-14 9:06am    
Not such a bad idea! I was unable to recreate the problem so this could have been "one of those things". I might delete the contents of the bin and obj folders under a solution (or Clean Solution for c#) which sometimes helps

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900