473,657 Members | 2,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to control the scroolbar.locat ion of ListView?

How to control the scroolbar.locat ion of ListView?

I have a ListView with many items.
I want to locate ListView scrollBar to bottom, top, or some item.

How can I do that ?

Thanks

Charles Shao

Nov 17 '05 #1
1 1342
On Mon, 4 Apr 2005 17:40:35 +0800, cyshao wrote:
How to control the scroolbar.locat ion of ListView?

I have a ListView with many items.
I want to locate ListView scrollBar to bottom, top, or some item.

How can I do that ?


You could do something like this:

Setting it to the top:
ListViewItem firstItem = _lstTest.Items[0];
firstItem.Ensur eVisible();

Setting it to the bottom:
ListViewItem lastItem = _lstTest.Items[_lstTest.Items. Count - 1];
lastItem.Ensure Visible();

So the secret is "EnsureVisible( )". If you have the ListViewItem just call
EnsureVisible() .

hth
--
Claudio Grazioli
http://www.grazioli.ch
Nov 17 '05 #2

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

Similar topics

0
2327
by: willow1480 | last post by:
I am developing a small little Service Control Application. I am using a listview control with checkboxes and getting the list of services I want to control from a text file. When you check a checkbox, it should either stop the service or start the service depending on each respective service's status. I want the listView to update the status for each service as they are checked. instead all I can seem to do is clear the listView and I...
2
1293
by: MM | last post by:
Hi, I have a data structure like this:- Param1 Param2 Param3 etc 0 15.2 10.0 5 8.4 50.0 etc. Basically I need a spreadsheet like control to display/modify this data. The DataGrid control seems to have a strong bias to db stuff (or am I wrong on this?). Does C# have just a simple grid control? Thanks, matthew.
6
5027
by: Jack | last post by:
Hello, I've noticed through searching this group's previous posts that one can get the item the mouse is over in a listview control but I did not see how to get the subitem the mouse is over. Is this possible? I intend on replacing an ActiveX grid with a listview control from a VB6 application that I've upgraded to VB .NET. The existing functionlality uses the mouseover event of the grid to display specific information within...
3
3501
by: Yoavo | last post by:
Hi, I have a ListView control and I make it disabled when a certain event occur. My problem is that when the control become disabled, the selection on the selected item is gone. (I want that the user will still be able to see the selected item). Yoav.
0
8324
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8513
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7352
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.