これは知っている/知っている便利なものかもしれないと思った。2つのList(s)/ Collectionsを持つforループを実行します。 Visual Basic
私はクラス内に2つの別々のリストを持っています。 2つのリストを使ってFor/Nextループを実行する簡単な方法がありますが、この例では2つの別々のForが必要ですか?
IE:
Public Structure Location
Public Name As String
Public ID As Integer
Public IsSub As Boolean
End Structure
Public Shared MainLocationList As List(Of Location)
Public Shared SubLocationsList As List(Of Location)
Public Shared Function Get_Location_By_ID(id As Integer) As Location
For Each location As Location In MainLocationList And SubLocationsList
If location.id = id then
Return location
End If
Next
End Function
私はリストに私が検索できることを実現する、しかしImはまた、2つのコントロールの二つの異なるタイプのリスト、またはコレクションなど
大変感謝しています。 – Josh