davedwards
Feb 15th, 2002, 07:59 PM
I'm developping an ActiveX Control (A) and I need to get a reference to another activex control (B) on the same form. The Problem is that the other ActiveX Control (B) is not listed in the ParentControls Collection except the first time I drop ActiveX Control (A) onto the form.
Here's the Code:
Private m_MapWin as tkMapWin.IMapWin ' Interface to MapWin
Private Sub FindMapWin()
Dim obj As Object
For Each obj In UserControl.ParentControls
If TypeOf obj Is tkMapWin.MapWin Then
Set m_MapWin = obj.Object
Exit Sub
End If
Next obj
End Sub
Here's the Code:
Private m_MapWin as tkMapWin.IMapWin ' Interface to MapWin
Private Sub FindMapWin()
Dim obj As Object
For Each obj In UserControl.ParentControls
If TypeOf obj Is tkMapWin.MapWin Then
Set m_MapWin = obj.Object
Exit Sub
End If
Next obj
End Sub