Click to See Complete Forum and Search --> : How do I make an item in a listview scroll into view?


yenni
April 5th, 2000, 12:41 PM
If I am searching for an item in a listview and it is out of view, how do I make it scroll into view and be at the top of the listview, just like the INDEX search in Windows Help?

Johnny101
April 5th, 2000, 01:28 PM
Try the EnsureVisible method of that item.

Once you find the item you want to show call that method and it should do it.

hope this helps,

John

John Pirkey
MCSD
http://www.ShallowWaterSystems.com
http://www.stlvbug.org

yenni
April 5th, 2000, 02:02 PM
I have already tried that, but it only works if the item is already in view.

swalsh19
April 5th, 2000, 07:04 PM
Right Click the Listview and select properties.

Set the following dropdown boxes to:
MousePointer: 0-ccDefault
View: 3-lvwReport
Arrange: 0-lvwNone
LabelEdit: 1-lvwManual
Borderstyle: 1-ccFixedSingle
Appearance: 1-cc3D
OLEDragMode: 0-ccOLEDrarManual
OLEDropMode: 0-ccOLEDropNone

The following boxes should be checked:
HideSelection
LabelWrap
Enabled
FullRowSelect



This is what I have in my project to get the scrollbars to scroll...

yenni
April 6th, 2000, 02:01 PM
Thanks for the help, but that is not I am looking for. I want the item to be the first one at the top of the listview, just like when u type the VB Help Topics by INDEX in VB.