VB Code:
Dim WithEvents objExt As VBControlExtender ' Declare VBControlExtender variable
Private Sub LoadControl()
Licenses.Add "MyControl.Control"
Set objExt = Controls.Add("MyControl.Control", "myCtl")
End Sub
Private Sub extObj_ObjectEvent(Info As EventInfo)
' Program the events of the control using Select Case.
Select Case Info.Name
Case "Click"
' Handle Click event here.
' Other cases now shown
Case Else ' Unknown Event
' Handle unknown events here.
End Select
End Sub
Private Sub Command1_Click()
Call LoadControl
End Sub