473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Listview control won't scroll fully

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
4 2309
* 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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: AndyDunning | last post by:
Folks, I'm loading a listview on a form with Vehicle Data for a specified client. I also pass in a specific registration relating to a current client request. The record is displayed and the...
4
by: alan | last post by:
Hello, Anyone know how to scroll down the listview by code? Eg. I have 200 items in the listview. When I set the selectedItem to be item 180, the user cannot see it if he don't scroll it down. ...
2
by: Adam Klobukowski | last post by:
Hello i need to find out the last fully visible item of a Llistview. If it would be a treeview then it would be easy, I'm even thinkin of faking my treeview as listview, but maybe there is some...
2
by: Matt Michael | last post by:
Hi, I'm having a problem working with a listview in an application I'm writing. Currently, whenever the selectedindex changed event fires, it loads up a htmledit control, and other labels on the...
2
by: Mark | last post by:
I have basically a 2 part question: 1) is there a way to have a listview that can scroll, but hide the scrollbars. I know that sounds odd, but this is a touch screen app and there are "scroll...
12
by: J L | last post by:
When I fill a listview, I resize the columns to fit the data. I need to know if the data will fit vertically or if there will be a vertical scroll bar. I need to know this so I can allow for it on...
0
by: alcurb | last post by:
I have a ListView control populated with 30 items. ListView height only allows you to see 20 rows at a time. I want to drag an item to the bottom of the list (to the last row), but ListView...
6
by: Mike Johnson | last post by:
I have a ListView on a form, I'm displaying the items as a list. The Scroll is set to true. I want to know how can I set the scroll bar to Vertical?
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.