|
-
Apr 26th, 2020, 08:20 AM
#1
Thread Starter
New Member
[RESOLVED] Detecting a click on a picturebox generated from an array?
Hello, vbforums
Is it possible for me to detect a click on a picturebox generated from an array? In my code, I have a function that declares new pictureboxes and puts them in a random location. I have another array called boxhp, which is an integer and has the same amount of items in at as the number of pictureboxes. When I click on a picturebox, I want the corresponding boxhp to decrease. For example, when I click on box(6), I want boxhp(6) to decrease in value.
I cannot create an event handler for every single box, as it would be impractical due to the sheer amount of pictureboxes.
There is probably something incredibly simple I'm missing here, but oh well
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|