Ok, I'm in a similar situation except that I'm using a VBControlExtender and it still doesn't work. Here's what the code looks like:
Project1.UserControl1:
Project2.UserControl2:VB Code:
Private WithEvents m_ctlDynamicDevice As VBControlExtender Public Sub SomeSub() Set m_ctlDynamicDevice = UserControl.Controls.Add("Project2.UserControl2", "DynDev") End Sub Private Sub m_ctlDynamicDevice_ObjectEvent(info As EventInfo) If info.Name = "OnSomeEvent" then 'handle the event End If End Sub
VB Code:
Event OnSomeEvent Public Sub TriggerEvent RaiseEvent OnSomeEvent End Sub
I can step into the TriggerEvent routine, but when the event is raised, I can't step into the ObjectEvent routine. Also, UserControl.Controls.Add returns a valid object and that object does not change between the time its added and the time the event handler should be called.




Reply With Quote