I need assign the Click event of a label that was created programmatically.
My code is working, but still can not assign the Click event dynamically:
Public Sub Create_Label()
Dim ctl As Control
Dim pic2 As String
pic2 = "C:\Documents\Pictures\Convert 24 bits.bmp"
Set ctl = UserForm1.Controls.Add("Forms.Label.1", "lblLabel1", True)
ctl.Caption = ""
ctl.Left = 20
ctl.Top = 30
ctl.Visible = True
ctl.Height = 72
ctl.Width = 72
ctl.Picture = LoadPicture(pic2)
'Assign click event
End Sub
Can anyone help me with this?
My code is working, but still can not assign the Click event dynamically:
Public Sub Create_Label()
Dim ctl As Control
Dim pic2 As String
pic2 = "C:\Documents\Pictures\Convert 24 bits.bmp"
Set ctl = UserForm1.Controls.Add("Forms.Label.1", "lblLabel1", True)
ctl.Caption = ""
ctl.Left = 20
ctl.Top = 30
ctl.Visible = True
ctl.Height = 72
ctl.Width = 72
ctl.Picture = LoadPicture(pic2)
'Assign click event
End Sub
Can anyone help me with this?