Join 150,087 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,764 people online right now. Registration is fast and FREE... Join Now!
hey i am trying to retrieve data from my sorted listbox and put it into a label...any ideas
vb
listbox1 = data listbox2 = sorted data this is how i have sorted data into listbox2 Dim list As New ListBox.SelectedObjectCollection(ListBox1) Dim strItem As String For Each strItem In ArrayList.Adapter(list).ToArray If ListBox2.Items.IndexOf(strItem) > -1 Then MessageBox.Show("You have already selected that paragraph") ListBox2.Items.RemoveAt(ListBox1.Items.IndexOf(strItem)) ListBox2.SelectedItems.IndexOf(strItem) End If Next ListBox2.Items.AddRange(ArrayList.Adapter(list).ToArray) 'adds selected item to listbox2
hey i am trying to retrieve data from my sorted listbox and put it into a label...any ideas
listbox1 = data listbox2 = sorted data this is how i have sorted data into listbox2
vb
Dim list As New ListBox.SelectedObjectCollection(ListBox1) Dim strItem As String For Each strItem In ArrayList.Adapter(list).ToArray If ListBox2.Items.IndexOf(strItem) > -1 Then MessageBox.Show("You have already selected that paragraph") ListBox2.Items.RemoveAt(ListBox1.Items.IndexOf(strItem)) ListBox2.SelectedItems.IndexOf(strItem) End If Next ListBox2.Items.AddRange(ArrayList.Adapter(list).ToArray) 'adds selected item to listbox2
thanx
This post has been edited by PsychoCoder: 2 Jun, 2008 - 11:33 AM