Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datalist Scrolling

Status
Not open for further replies.

DonRI

Programmer
Jun 10, 2005
11
US
I am new to using VB6. If a user highlights an item in a datalist, but then scrolls the selected item out of sight, is there anyway to automatically force the highlighted item to reappear? I've looked around but don't happen to see a solution. Thanks.
 
That depends on what kind of datalist you're using, but usually some combination of a scrollTo command (or similar) with a command that returns the position of the selected row will do the job.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
If you are using an ordinary Listbox then you should use the TopIndex property.
[tt]If List1.ListIndex >= 0 Then List1.TopIndex = List1.ListIndex[/tt]

If you are using a ListView control then you should use the EnsureVisible method.
[tt]ListView1.SelectedItem.EnsureVisible[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top