Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. list box control

list box control

Scheduled Pinned Locked Moved Visual Basic
csharphelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sixecho
    wrote on last edited by
    #1

    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'''''

    M 1 Reply Last reply
    0
    • S sixecho

      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'''''

      M Offline
      M Offline
      mr_lasseter
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups