Ensurevisible doesn't work in listview when scrollable = false

G

Guest

Hello all

I'm using a listview in my app but I want to scroll the listview
programatically as I hate the look of the standard scrollbar.

So, the listview is scrolled programatically using ensurevisible, ie the
listview shows a maximum of 6 items and if I want to scroll down one I use
the code...

listview.ensurevisible(listview.TopItem.Index + 6)

The problem I have is that I hide the vertical scrollbar using scrollable =
false but, when that is set, ensurevisible doesn't work. It seems that
ensurevisible depends on the listview being scrollable but I the only way I
can find to hide the scrollbar is to set scrollable to false.

Does anyone know of a way to either hide the scrollbar while keeping
scrollable to true or make ensurevisible work when scrollable = false?

Any help would be greatly appreciated.

Thanks
Ben
 
P

Patrice

The first thing I would try would be to change this property just the time
of the EnsureVisible call...
 
G

Guest

Patrice, thanks for replying.

Yes, that's good thinking but I already tried that. I tried...

listview.Scrollable = true
listview.ensurevisible(listview.TopItem.Index + 6)
listview.Scrollable = false

but it doesn't work. If I rem out the last line it works but of course the
scrollbar is still there so it seems that as soon as you turn off scrollable
the listview is reset to the its initial state.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top