-
Apr 6th, 2012, 06:21 PM
#1
Thread Starter
New Member
Help with one handler for an array of labels.
I have a 2 dimensional array of labels that are created at runtime and I do not know how many labels will be created before running the program. How do I make one handler to change the background color of the label clicked.
I already have for each label when created:
AddHandler Labels(j, i).Click, AddressOf Labels_Click
But in the handler how do I change the background color of the label that was clicked?
-
Apr 6th, 2012, 06:52 PM
#2
Re: Help with one handler for an array of labels.
try this
vb Code:
Private Sub Labels_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim lb As Label = DirectCast(sender, Label) lb.BackColor = Color.Red End Sub
-
Apr 6th, 2012, 06:56 PM
#3
Thread Starter
New Member
Re: Help with one handler for an array of labels.
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
|