How do I scroll a list box to a specific item via code
Posted on 2007-10-10
I have an asp.net page which contains a listbox with 100 or so items. The page also contains a number of other controls. When the user clicks on another item on the page, I want to automatically scroll the listbox to a certain item in the list. Using the code MyListBox.SelectedItem = 25 will select the item but does not scroll to it. I saw some references to using SendMessage to the control but I don't know how to get the handle for the control. Does anyone have thoughts on how to accomplish the scroll?