* Murt said:
if i perform a sort on an array, how do i get the sorted array to be
displayed in a listbox?
Sample for binding an arraylist to a listbox:
\\\
Private Sub Test()
FillListBox("F1#Function1|F2#Function3", Me.ListBox1)
End Sub
Private Function FillListBox( _
ByVal Data As String, _
ByVal List As ListBox _
)
Dim s, t() As String, x As Item
Dim al As New ArrayList()
For Each s In Strings.Split(Data, "|")
x = New Item()
t = Strings.Split(s, "#")
x.TheText = t(1)
x.TheValue = t(0)
al.Add(x)
Next s
List.DataSource = al
List.DisplayMember = "TheText"
List.ValueMember = "TheValue"
End Function
Private Class Item
Private m_TheText As String
Private m_TheValue As String
Public Property TheText() As String
Get
Return m_TheText
End Get
Set(ByVal Value As String)
m_TheText = Value
End Set
End Property
Public Property TheValue() As String
Get
Return m_TheValue
End Get
Set(ByVal Value As String)
m_TheValue = Value
End Set
End Property
End Class
///