#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Location
    Woodstock, GA
    Posts
    1
    Rep Power
    0

    Scroll selected item to top in ListBox control


    I have a multiple select list box control on an aspx page controlled by VB code. I only have enough real estate to show 5 items in the list at any one time, therefore, the list box contains more items than will show at any one time. When an items is selected, the OnSelectedIndexChanged event is fired which gathers the selected items for later processing and the aspx is refreshed. This all works fine with the following problem, the refresh of the aspx always shows the very top portion of the list in the list box control regardless of which items are selected. How do I force it to automatically scroll down to the first selected item in the list if this item is not in the topmost portion of the list? In PowerBuilder, I would just do a ScrollToTop and supply it with the index of the item I wanted it to scroll to. I cannot find any way to do that with VB. Any help would be greatly appreciated. Thanks in advance for your help.
  2. #2
  3. No Profile Picture
    Getting my *facts* right
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Location
    Amritsar, India
    Posts
    177
    Rep Power
    11
    you can do list1.topindex=somevalue in vb6. i'm not sure about vbscript.
    IMHO

IMN logo majestic logo threadwatch logo seochat tools logo