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

Home Posts Topics Members FAQ

listview scrollbar question

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.
Mar 7 '06 #1
2 6910
What you want to do is create a class that derives from ListView where
you override the WndProc method. You want to handle the WM_VSCROLL and
WM_HSCROLL messages. When the message fires, you can raise an event to
indicate that the scroll position changed in the listview.

Then, have the listviews subscribe to those events on each other, and
have the scroll position change when it changes in the other list view.

You will have to make sure that you don't get into an infinite loop,
since when you move the scrollbar in response to the first lisview scroll
moving, it will fire the same event.

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

<Co**********@a l.com> wrote in message
news:11******** ********@despin a.uk.clara.net. ..
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.

Mar 7 '06 #2
Hello Co**********@al .com,

The idea is here http://www.dicks-blog.com/archives/2...box-scrolling/
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.

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 7 '06 #3

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

Similar topics

2
4736
by: David Miller | last post by:
Hello, I posted this to DotNet.Framework.Controls a week ago or so and got no response, so now I will repost it here to see if anyone here knows anything about it... I have an application that displays items in a ListView control that is running on a Windows 98 SE machine. The machine is well within system specifications for the .Net...
1
812
by: paolo.riba | last post by:
Hi everybody! Could anyone know how can I syncronize a horizontal scrollbar with a listview? Actually I can only syncronize the horizontal scrollbar with the listview horizontal scrollbar, but items and subitems don't move. The code is: API declaration ' Scrollbar direction ' All these constents can be found in WinUser.h
2
2547
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 listview... the thing is i want the listview to scroll to the last item all the time but only when the scrollbar is in the bottom... Thanks...
5
22477
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 position of the scrollbars after reloading the data. But I can’t figure out how to retrieve the scrollbar position (both horizontal and vertical). ...
5
6415
by: Bernie Yaeger | last post by:
I'm using a listview in view 'list' mode, multiselect and dragdrop true. When the listview appears, it has a horizontal scrollbar (if needed) but not vertical scrollbar. How can I get it to display a vertical scrollbar? Thanks for any help. Bernie Yaeger
12
7466
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 the overall size of the listview. My question therefore is, how can I tell if the items I have added will fit in the listview at its given...
2
4075
by: Ben H | last post by:
Hello all I'm using a listview in my app but I want to scroll the listview programatically as I hate the look of the standard scrollbar. So, the listview is scrolled programatically using ensurevisible, ie the listview shows a maximum of 6 items and if I want to scroll down one I use the code... ...
1
9289
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 way to hide the vertical scrollbars and display horizontal scrollbars?
1
3543
by: Kimmo Laine | last post by:
Hi! I need to resize the last column in my listview control so that there won´t be horizontal scrollbar. Lets first create lv and add some items: listView1.View = View.Details;
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...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
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.