list box control
-
i used this line to select items in a row in a list box ''''''ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1'''''' but when i get to the last item an error occures ERROR :(((argument out of range exception was unhandled))) can any one give a solution '''''VB.NET 2005'''''
-
i used this line to select items in a row in a list box ''''''ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1'''''' but when i get to the last item an error occures ERROR :(((argument out of range exception was unhandled))) can any one give a solution '''''VB.NET 2005'''''
You are getting the error becuase there is no item after the last item in the list. I am not sure what you are trying to accomplish, but you should check to see if you are currently selecting the last item in the list (use ListBox.Items.Count) and either don't move change the selectedIndex or you could set the selectedIndex to 0, to go back to the first item in the list.
Mike Lasseter