I'm doing a skinable app which creates transparent labels which when clicked bitblts a button down effect on a picturebox. I have managed to create the array of labels and have them positioned right, but I cant seem to capture the click of these labels.
above it the code which I use to create the labels, and I need help with the click event of these.
I would of though its something like ..
but I'm getting a WithEvents variable required
the butcommand string array holds the info thats sent to the sdk sub that does the action.
can anyone shed a little light on this ?
thanks
Steve
VB.NET:
Do While Not lb
labelsize = Split(ReadIni("menu", "b" & n, "0,0,0,0,0", "\skins\" + defaultskin + "\skin.ini"), ",")
If labelsize(4) = "0" Then lb = True
MyControlArray.AddNewLabel()
With MyControlArray(n - 1)
.Parent = PictureBox1
.BackColor = Color.Transparent
.Left = PictureBox1.Width * (labelsize(0) / picwidth)
.Top = PictureBox1.Height * (labelsize(1) / picheight)
.Width = PictureBox1.Width * (labelsize(2) / picwidth)
.Height = PictureBox1.Height * (labelsize(3) / picheight)
.Visible = True
End With
ReDim Preserve butcommand(n)
butcommand(n - 1) = labelsize(4)
n = n + 1
Loop
I would of though its something like ..
VB.NET:
Private Sub MyControlArray_click(ByVal Index As Integer, ByVal Sender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyControlArray.Click
Form1.sdk(butcommand(Index))
End Sub
the butcommand string array holds the info thats sent to the sdk sub that does the action.
can anyone shed a little light on this ?
thanks
Steve