item selecting in list
-
i am creting a playlist in vb.net and i need to create a few buttons that select all the items in a list and two further buttons to select the item above and item below. can anyone tell me how i would go about that.
-
i am creting a playlist in vb.net and i need to create a few buttons that select all the items in a list and two further buttons to select the item above and item below. can anyone tell me how i would go about that.
For listbox: Select All: It is necessary to switch modes on select all
ListBox1().SelectionMode = SelectionMode.MultiSimple For i As Integer = 0 To Me.ListBox1.Items.Count - 1 Me.ListBox1.SetSelected(i, True) Next
Select Previous:ListBox1().SelectionMode = SelectionMode.One If Me.ListBox1.SelectedIndex > 0 Then Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex - 1 End If
Select Next:ListBox1().SelectionMode = SelectionMode.One If Me.ListBox1.SelectedIndex < Me.ListBox1.Items.Count - 1 Then Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1 End If
Posted by The ANZAC
-
For listbox: Select All: It is necessary to switch modes on select all
ListBox1().SelectionMode = SelectionMode.MultiSimple For i As Integer = 0 To Me.ListBox1.Items.Count - 1 Me.ListBox1.SetSelected(i, True) Next
Select Previous:ListBox1().SelectionMode = SelectionMode.One If Me.ListBox1.SelectedIndex > 0 Then Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex - 1 End If
Select Next:ListBox1().SelectionMode = SelectionMode.One If Me.ListBox1.SelectedIndex < Me.ListBox1.Items.Count - 1 Then Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1 End If
Posted by The ANZAC
thanks alot matey thats a great help to my cause. much apreciation