469,156 Members | 2,308 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,156 developers. It's quick & easy.

Ensurevisible doesn't work in listview when scrollable = false

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
Mar 23 '06 #1
2 3681
The first thing I would try would be to change this property just the time
of the EnsureVisible call...

--
Patrice

"Ben H" <Be**@discussions.microsoft.com> a écrit dans le message de news:
5F**********************************@microsoft.com...
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

Mar 23 '06 #2
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.

"Patrice" wrote:
The first thing I would try would be to change this property just the time
of the EnsureVisible call...

--
Patrice

"Ben H" <Be**@discussions.microsoft.com> a écrit dans le message de news:
5F**********************************@microsoft.com...
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


Mar 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Anushya devi | last post: by
reply views Thread by Tim Bücker | last post: by
reply views Thread by Shaw | last post: by
1 post views Thread by schaf | last post: by
4 posts views Thread by Brian Gaze | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.