selected items in list
-
sorry i explained the query wrong. i need to use a button to replace the selected item with the one above, and do the same with the one below. i suppose this code could be modified a bit but dont know how. can anyone help me please. 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
-
sorry i explained the query wrong. i need to use a button to replace the selected item with the one above, and do the same with the one below. i suppose this code could be modified a bit but dont know how. can anyone help me please. 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