By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,160 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

Ensurevisible doesn't work in listview when scrollable = false

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.