Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with VbControlExtender

Status
Not open for further replies.

FireFett

Programmer
Mar 31, 2000
42
US
I am having problems catching events from the VbControlExtender.

I have an right now just a generic activex control no code or control placed in it and complied it as and OCX.

I then have a project that dynamically loads the the control and want to catch any events that might be fired from the user control. Problem is the extender isn't reporting back any events even a dblclick. Anyone see a problem with why my codes not working.

Private WithEvents EmbeddedControl As VBControlExtender


Private Function CreateControl(ByVal strControlName As String)

If Not EmbeddedControl Is Nothing Then
Controls.Remove "Embedded"
Set Embedded = Nothing
End If

Set EmbeddedControl = Me.Controls.Add("Project1.UserControl1", "Embedded")
EmbeddedControl.Visible = True

End Function

Private Sub EmbeddedControl_GotFocus()
MsgBox "Hey"
End Sub

Private Sub EmbeddedControl_ObjectEvent(Info As EventInfo)

MsgBox Info.Name
End Sub

Private Sub Form_Load()
CreateControl "Test"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top