473,569 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

listview autoscroll event?

How do i detect that the vertical scroll bar has been
moved and how do i get the vertical scrollbar value from
a listview. I need to do this to synchronise a textbox
movement within the listview.
Nov 15 '05 #1
2 5055
Ashley,

You will have to create a class that derives from ListView. In this
class, you will have to override the WndProc method and process the
WM_VSCROLL or WM_HSCROLL messages. The scrollbars send this to the ListView
in order to indicate that the scroll has been moved.

When processing that message, you can move the other windows
appropriately. Also, you can call the GetScrollInfo API function through
the P/Invoke layer to get the appropriate information about the standard
scroll bars for a window (using the handle for the ListView control).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"ashley" <an*******@disc ussions.microso ft.com> wrote in message
news:56******** *************** *****@phx.gbl.. .
How do i detect that the vertical scroll bar has been
moved and how do i get the vertical scrollbar value from
a listview. I need to do this to synchronise a textbox
movement within the listview.

Nov 15 '05 #2
Thanks Nicholas,

Have you got any code examples. It would help!

Ashley.
-----Original Message-----
Ashley,

You will have to create a class that derives from ListView. In thisclass, you will have to override the WndProc method and process theWM_VSCROLL or WM_HSCROLL messages. The scrollbars send this to the ListViewin order to indicate that the scroll has been moved.

When processing that message, you can move the other windowsappropriatel y. Also, you can call the GetScrollInfo API function throughthe P/Invoke layer to get the appropriate information about the standardscroll bars for a window (using the handle for the ListView control).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"ashley" <an*******@disc ussions.microso ft.com> wrote in messagenews:56******* *************** ******@phx.gbl. ..
How do i detect that the vertical scroll bar has been
moved and how do i get the vertical scrollbar value from a listview. I need to do this to synchronise a textbox
movement within the listview.

.

Nov 15 '05 #3

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

Similar topics

2
410
by: Mike Ruane-Torr | last post by:
I have a design problem involving a ListView control on a Windows form. What it boils down to is the following question: Q: Is there a way to tell the difference between a ListView.ItemCheck event that has occurred because of a mouse click on a Checkbox, and one that has occurred because the .Checked property of an item has been changed...
0
466
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 corresponding record in the listview appears selected. The problem I have is that if the number of records loaded in the listview can't all be...
2
4194
by: Mad Joe | last post by:
Hello! Can someone help me, please? It's 6am, I don't have concentration, feel desperate and I have a deadLine for my project (exam at my university).. How can I display ListView onMouse Click event? Let's say that I just need a detailed view of columnHeaders. Somewhere in my code there is already prepared array:
0
1211
by: Peter | last post by:
Hi,everyone, I'm using a listview control to deal with data. The ItemCheckEventArgs have 2 properties:CurrentValue and NewValue in listview.itemcheck event. Can anybody tell me when does the newvalue become currentvalue after the event? I'm worring about this because 'listview1.CheckedItems.Count()' didn't change after I changed...
3
2280
by: Tom Bianchi | last post by:
Hi, I have a Panel with the AutoScroll property set to True and many TextBoxes into it, with only some of them positioned in the visible portion of the panel. Is there a Panel event that I can handle when I tab from textbox to textbox and the panel has to scroll *automatically* from the current position to bring the focused control into...
2
6611
by: ian.watkins | last post by:
I'm having a problem with the listview itemcheck event since upgrading a smart device app from VS2003 VB.NET CF1.0 to VS2005 VB.NET CF2.0. I'm using the listview item checkbox to indicate if the item is "processed". When the item becomes processed, i set the listviewitem.checked property to true. To prevent the user from changing the...
0
2884
by: eweaver | last post by:
Hello, I have a problem with getting an autoscrollbar to end up where I want it. Things to know about the prob: I have an imagebox inside of a Panel for (inheritance of) autoscroll capabilities. The imagebox is named panel2 for my own conventions and the panel will be named panel1 Panel2 (the imagebox) is set to fit to the size of Panel1 (the...
12
4002
by: Tom Bean | last post by:
I am trying to display a ContextMenuStrip when a user right-clicks on an item in a ListView and have encountered a something that seems strange to me. When the ListView is initially populated, no items are selected. When the first item is selected by clicking either the left or right button, the SelectedIndexChanged event fires but not the...
0
1197
by: viepia | last post by:
Hi, What is the best way to find the row/column of a System.Windows.Forms.ListView MouseDoubleClick event? Searching the rows and columns for SelectedItems will not work for me, too many duplicated values. Thanks Viepia
0
7618
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...
0
7926
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. ...
1
7679
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...
0
7983
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...
0
6287
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...
1
5514
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...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.