두 개의 BindingSource 및 Dictionary 개체가 있습니다. 그리고 BindingSource 객체는 Vehicle Class Object의 객체를 포함하고 Dictionary 객체는 BindingSource 클래스 객체를 포함합니다. 그리고 여기에 글로벌 선언입니다 :사전에서 BindingSource의 개체를 검색하는 방법
Dim bs As BindingSource
Dim dicBinding As Dictionary(Of Integer,BindingSource)
와 사용자가 클릭 버튼 내가 dicBinding에 학사를 기지국으로 차량 클래스의 객체를 추가 한 다음 추가 "추가"라는 이름의 경우 :
If bs Is Nothing Then bs = New BindingSource(New List(Of Vehicle),Nothing)
If dicBinding is Nothing Then dicBinding = New Dictionary(Of integer,BindingSource)
Dim i As Integer = dicBinding.Count
dicBinding.Add(i,bs)
내가 검색하고자 할 때 dicBinding 개체의 BindingSource 개체 :
bs =TryCast(dicBinding.Item(0),BindingSource)
For Each v As Vehicle In bs.List
MessageBox.Show(v.VehicleId)
Next
하지만 검색 할 수 없습니다. 누구든지 나를 도울 수 있을까?
'dicBinding.Add (bs)'가 작동해서는 안됩니다. 'Dictionary.Add'는 키와 값을 필요로합니다. – prprcupofcoffee
예 .. 죄송합니다. 그러나 그것은 나의 문제 점이 아니다. 내 문제는 내가 사전에서 검색하고 싶습니다. :) – Ericton