473,388 Members | 1,385 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,388 software developers and data experts.

Detecting the appearance of a scrollbar in a listview

I have a listviw with the column default widths adjusted to fill the entire
width without any scroll bars. If there are enough items added to the list
that a vertical scroll bar is added I'd like to narrow the last column to
avoid the creation of an Hscroll as well. I'm not sure how to tell if the
addition of annother item will extend the length of the list beyond the
hieght of the control though.
Nov 17 '05 #1
1 2787
Insert the following code after the code that you use to add or remove items
from the ListView.

if (this.listView1.Columns.Count > 0)
{
this.listView1.Columns[this.listView1.Columns.Count - 1].Width = -2;
}

--
Tim Wilson
..NET Compact Framework MVP

"Dan Neely" <Da******@discussions.microsoft.com> wrote in message
news:99**********************************@microsof t.com...
I have a listviw with the column default widths adjusted to fill the entire width without any scroll bars. If there are enough items added to the list that a vertical scroll bar is added I'd like to narrow the last column to
avoid the creation of an Hscroll as well. I'm not sure how to tell if the
addition of annother item will extend the length of the list beyond the
hieght of the control though.

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Kovan A. | last post by:
since i couldnt find anyway to scroll a listview having disabled the scrollbars, i am left with no choice but to make the current scrollers bigger any leads as to which beast i am up against for...
2
by: | last post by:
Hi, Trying to figure out how i can tell if the scrollbar is in the bottom of my listview, im using the listview to display log files and i track them and add new items to the bottom of the...
5
by: Frank Rizzo | last post by:
I reload the items in the listview on a regular schedule (i.e. clear the listview, then load it up with fresh values). I want add a convinience to the user whereby my application remembers the...
1
by: poldoj | last post by:
Hi all. I am just wondering if there is a method for manipulating the textboxs scrollbar appearance, both vertical and horizontal. In particular I would like to reduce the width of textbox...
2
by: | last post by:
Hi All, How can I get to scroll bars of a listview, I am trying to sync two listviews so I need to overload one of the listview, How can I achieve this ? Thank You.
1
by: malpani.abhijit | last post by:
Hi, I am having a ListView component in my WinForm, when i add some images into it, it gives me a vertical scroll bar. What i want is, the horizontal scrollbar instead of vertical. Is there any...
1
by: Lubomir | last post by:
Hi, I have a ListView with one column and no header. How to display the horizontal scrollbar if one of the items is too long? Scrolable property is set to true. Thanks, Lubomir
1
by: EdB | last post by:
I am trying to indentify an event in the ListView control that will tell me that the user is scrolling through the list, or even that they have clicked on the scrollbar. Is this possible?
3
by: Dilip | last post by:
I inherited an owner drawn control that subclasses the Windows Forms ListView control to provide additional functionalities. I wanted to detect the presence of the Vertical scrollbar so that I can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.