Here's how you can go about this:
Public Structure DataStructure
Private s As String
Public Property Str() As String
Get
Return s
End Get
Set(ByVal Value As String)
s = Value
End Set
End Property
End Structure
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim o(2) As DataStructure
o(0) = New DataStructure
o(0).Str = "Item 1"
o(1) = New DataStructure
o(1).Str = "Item 2"
o(2) = New DataStructure
o(2).Str = "Item 3"
ListBox1.DataSource = o
ListBox1.DisplayMember = "Str"
End Sub
hope that helps..
Imran.
"LR" <lr@sympatico.ca> wrote in message
news:HO********************@news20.bellglobal.com. ..
Is it possible to use an array of structures as a datasource for a
control.
ie
dim structure structtest
dim str1 as string
dim str2 as string
end structure
dim artest() as structtest
how do I use the array as a data source for a list box?