protected structure Divisions
private divName as String
private divId as string
public sub new(name as String, id as string)
divName=name
divId = id
End Sub
public readonly property getName() as String
get
return divName
End Get
end property
public readonly property getId() as string
get
return divID
End Get
End Property
End structure
dim myDivisions as new ArrayList
'add division structure entries to the arraylist
with myDivisions
.Add(new divisions("上海大众","1")
.Add(new Divisions("上海通用","2")
end With
'bind the arraylist to the combo box
With combobox1
.datasource=myDivisions
.DisplayMember = "getName"
.ValueMember = "getId"
End With