I created an Activex Control.
In my application I did not added it to the toolbox. I'm creating it dynamically. This is the code I use:
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
I can handle the events. However, does anyone know how I can access the methods and properties I created for the control when adding the control dynamically to the form?
I can use access them fine when I add it to the toolbox.




Reply With Quote