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

Listview control won't scroll fully

P: n/a
I have a listview control on a simple vb.net form that's populated
programmatically. It is set to scrollable and a scroll bar duly
appears. However the scroll bar doesn't allow the bottom rows of the
list to be seen.

For example, if I have 31 rows in the list with the control set to a
height that shows maybe 20 rows then the scroll bar allows me to get
down to eg row 28 as the bottom row, but not row 31. Yet if I drag the
bottom of the form to allow the listview control more height then all
31 rows are there. So it seems like the control is being fully
populated as expected, but the bottom few rows are simply not visible
when the listview is not allowed full height.

This is all a bit odd in that the scroll is sort of working but not
completely. Anyone have any idea what I might be doing wrong please? I
have the listview anchored top and left but I'm not sure why this
should make any difference?

JGD
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
* John Dann <ne**@prodata.co.uk> scripsit:
I have a listview control on a simple vb.net form that's populated
programmatically. It is set to scrollable and a scroll bar duly
appears. However the scroll bar doesn't allow the bottom rows of the
list to be seen.


What 'View' did you select for the control?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
On Sun, 27 Jun 2004 11:27:46 +0100, John Dann <ne**@prodata.co.uk>
wrote:
However the scroll bar doesn't allow the bottom rows of the
list to be seen.


OK, I've seen the problem - I had the listview height set to a larger
value than the form height. But this arose because being newish to
..net I couldn't quickly see a way in vb.net to do:

listview1.height=me.scaleheight

which I would have done in VB6 in order to make the control fill the
form area. I'm obviously missing something simple here, but what is
it?

JGD
Nov 20 '05 #3

P: n/a
On Sun, 27 Jun 2004 11:53:01 +0100, John Dann <ne**@prodata.co.uk>
wrote:
But this arose because being newish to
.net I couldn't quickly see a way in vb.net to do:

listview1.height=me.scaleheight

which I would have done in VB6 in order to make the control fill the
form area. I'm obviously missing something simple here, but what is
it?


Sorry for answering my own question a second time, but some more
digging shows that:

listview1.bounds = me.clientrectangle

should and does work. What's confusing me now is that neither 'bounds'
nor 'clientrectangle' showed up in the Intellisense yet the code seems
to work. Why would that be?

JGD
Nov 20 '05 #4

P: n/a
Take a look at the Anchor and Dock properties in the properites window for
the control. They may do want you want without needing to handcode
anything.

HTH,
Greg

"John Dann" <ne**@prodata.co.uk> wrote in message
news:hl********************************@4ax.com...
On Sun, 27 Jun 2004 11:53:01 +0100, John Dann <ne**@prodata.co.uk>
wrote:
But this arose because being newish to
.net I couldn't quickly see a way in vb.net to do:

listview1.height=me.scaleheight

which I would have done in VB6 in order to make the control fill the
form area. I'm obviously missing something simple here, but what is
it?


Sorry for answering my own question a second time, but some more
digging shows that:

listview1.bounds = me.clientrectangle

should and does work. What's confusing me now is that neither 'bounds'
nor 'clientrectangle' showed up in the Intellisense yet the code seems
to work. Why would that be?

JGD

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.