这个类如何写?
立早家饰 2007-03-12 07:00:51 Form1中有个Combobox1
我想做到
With ComboBox1
.DataSource = AreaList.Items
.DisplayMember = "Text"
.ValueMember = "Value"
End With
---------------------------------------------
类myList文件中有两个类:myItem、myItems
Public Class myItem
Private ListKey As String
Private ListText As String
Private ListValue As String
Private ListTag As Object
Public Property Key() As String
'省略,都是Get和Set
End Property
Public Property Value() As String
'省略
End Property
Public Property Text() As String
'省略
End Property
Public Property Tag() As Object
'省略
End Property
Public Sub New(ByVal sKey As String, ByVal sText As String, ByVal sValue As String)
ListKey = sKey
ListText = sText
ListValue = sValue
ListTag = Nothing
End Sub
End Class
'##############################
Public Class myItems
'myItem的集合
End Class
请问这个类myItems该怎么写?
要做到 myItems.Item(sKey) 就能找到对应的myItem