Results 1 to 4 of 4

Thread: Scrolling unselectable listbox [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575

    Scrolling unselectable listbox [RESOLVED]

    Hey,

    I have a listbox on my program, and whenever I add anything to it, i would like it to automatically scroll down to the bottom.

    i have this sorted, however... i want my listbox unselectable
    (SelectionMode = None) so that the user can't select one of the items, or have any of the items highlighted.

    I use this:
    listbox1.SelectedIndex = listbox1.Items.Count - 1

    but if the selectionmode = none then i get an error because it can't select any of the entries.

    So this method isn't going to help me... is there an alternative to scroll it to the bottom? I wouldn't have liked to use this method even if i had selection enabled, as i dont think its very sophisticated when you're actually just wanting to scroll, not wanting to select an item - this could bring up selected events and that would not be very good.

    thanks for the help - i did a search on this but all the results came up with the same method i have got.
    Last edited by LITHIA; May 25th, 2004 at 09:35 AM.

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Use the TopIndex Property:

    VB Code:
    1. lb1.TopIndex = lb1.Items.Count - 1

  3. #3

    Thread Starter
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575
    thanks, ill try it when i gets back home

  4. #4

    Thread Starter
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575
    thanks! that worked great

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width