Archie-
Whenever I change forms the list clears, I tracked it down to this code:
'********************************************************************
'* When an instance is added to the form, set the comm component
'* property. If a comm component does not exist, add one to the form
'********************************************************************
Protected Overrides Sub OnCreateControl()
MyBase.OnCreateControl()
If Me.DesignMode Then
'********************************************************
'* Search for AdvancedHMIDrivers.IComComponent component in parent form
'* If one exists, set the client of this component to it
'********************************************************
Dim i = 0
Dim j As Integer = Me.Parent.Site.Container.Components.Count
While m_ComComponent Is Nothing And i < j
If Me.Parent.Site.Container.Components(i).GetType.GetInterface("IComComponent") IsNot Nothing Then m_ComComponent = CType(Me.Parent.Site.Container.Components(i), MfgControl.AdvancedHMI.Drivers.IComComponent)
i += 1
End While
'************************************************
'* If no comm component was found, then add one and
'* point the ComComponent property to it
'*********************************************
If m_ComComponent Is Nothing Then
m_ComComponent = New AdvancedHMIDrivers.EthernetIPforCLXCom(Me.Site.Container)
End If
Else
SubscribeToComDriver()
End If
MyBase.Items.Clear()
End Sub
Why is this code executing in runtime and when changing forms?