| Zdravím, mal by som takú otázku. Mám funkciu  
 Public Function GenerateUserSettings(ByVal Collection As System.Collections.ArrayList) As System.Array
                Try
                    Dim str(Collection.Count - 1) As userXmlStructureSettings
                    For i As Integer = 0 To Collection.Count - 1
                        If TypeOf (Collection.Item(i)) Is System.Windows.Forms.Panel Then
                            str(i).name = Collection.Item(i).Name
                            str(i).visible = Collection.Item(i).Visible
                            str(i).valid = True
                        End If
                        If TypeOf (Collection.Item(i)) Is Sfera.Forms.Controls.TaskPanels.ExpandoPanel Then
                            str(i).name = Collection.Item(i).Name
                            str(i).visible = Collection.Item(i).Visible
                            str(i).collapsed = Collection.Item(i).Collapsed
                            str(i).valid = True
                        End If
                    Next
                    Return str
                Catch
                    Return Nothing
                End Try
            End Function
Ako parameter vstupuje kolekcia, v ktorej mám uložené všetky controly, rekurzívne získané z formulára. Na základe toho aký je to control plním jednotlivé položky štruktúty str. Problém nastáva, keď nastavím Option Strict On.  Neviem ako obísť Late Binding tak aby som to nemusel nejak zásadne prepisovať. Používam VB.NET 2003. Ďakujem za nápady. Vašo. |