473,770 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scrolling question...

I have two questions that I was hoping to get some input on:

1. How can I synchronize the horizontal scrolling of two controls on my
form? I realize that I will have to use the Windows API to do this, but I
haven't been very successful in determining exactly how. Are there any good
API references for .NET developers?

2. What would be the most efficient way to paint the background of a
scrollable user control in such a way as to suggest columns (using lines or
vertical bars of color, etc.) ?

If anyone can point me in the right direction, I would really appreciate it!

Thanks!
Nov 16 '05 #1
2 1228
Craig,

Depending on the controls that you are trying to scroll, you might be
able to use a managed interface. Generally speaking, you have to make sure
that the controls share the same dimensions if you want to do this.

Assuming that the controls fire the standard WM_VSCROLL and WM_HSCROLL
messages, you can catch those for your controls (you would have to hook into
the message loop) and then fire that to the other control with the same
parameters. It should cause the other control to scroll at the same time.

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

"craig" <e@mail.com> wrote in message
news:eV******** ******@TK2MSFTN GP14.phx.gbl...
I have two questions that I was hoping to get some input on:

1. How can I synchronize the horizontal scrolling of two controls on my
form? I realize that I will have to use the Windows API to do this, but I
haven't been very successful in determining exactly how. Are there any
good API references for .NET developers?

2. What would be the most efficient way to paint the background of a
scrollable user control in such a way as to suggest columns (using lines
or vertical bars of color, etc.) ?

If anyone can point me in the right direction, I would really appreciate
it!

Thanks!

Nov 16 '05 #2
Thanks Nicholas!

I have managed to hook into the message loop as you described by overriding
the WndProc method so that I can catch the WM_HSCROLL message. However, I
have not figured out how to fire this to the other control. Do you know how
that is done?

Thanks!!
Craig

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:u3******** ********@TK2MSF TNGP10.phx.gbl. ..
Craig,

Depending on the controls that you are trying to scroll, you might be
able to use a managed interface. Generally speaking, you have to make
sure that the controls share the same dimensions if you want to do this.

Assuming that the controls fire the standard WM_VSCROLL and WM_HSCROLL
messages, you can catch those for your controls (you would have to hook
into the message loop) and then fire that to the other control with the
same parameters. It should cause the other control to scroll at the same
time.

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

"craig" <e@mail.com> wrote in message
news:eV******** ******@TK2MSFTN GP14.phx.gbl...
I have two questions that I was hoping to get some input on:

1. How can I synchronize the horizontal scrolling of two controls on my
form? I realize that I will have to use the Windows API to do this, but
I haven't been very successful in determining exactly how. Are there any
good API references for .NET developers?

2. What would be the most efficient way to paint the background of a
scrollable user control in such a way as to suggest columns (using lines
or vertical bars of color, etc.) ?

If anyone can point me in the right direction, I would really appreciate
it!

Thanks!


Nov 16 '05 #3

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

Similar topics

0
1613
by: Donald Firesmith | last post by:
I am using Framesets (www.donald-firesmith.com, left primary navigation frame, soon to be xhtml) using: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> I want to enable vertical scrolling, but prohibit horizontal scrolling. There doesn't seem to be a way of doing this. I want to get rid of the unnecessary...
3
4690
by: Vikram Bhatia | last post by:
1. Is there an event to capture scrolling using mouse wheel in Netscape 6.x? 2. When arrow keys are used to scroll a page in Netscape 6.x, the scrolling offsets obtained using 'window.pageXOffset' and 'window.pageYOffset' are not correct. Is there any other way to get the correct scrolling offsets?
13
7298
by: al jones | last post by:
I guess one question at a time will work better. URL http://aljones.us (yes, I'm back again) I'd like to cause this whole page to fill the viewable window if I can. Meaning that I'd like the entire page to be visible on the current users screen. That means that I'd like one or both of the divs to scroll. I've found how to do that, I think, but can't seem to 'size' the page so it fits on
5
21699
by: Will Gillen | last post by:
I need to have a "scrolling" text label or textbox at the bottom of my window to show the URL of where a song is being played from. I want the text to scroll on a single line from left to right in case the URL is longer than the width of the textbox/text label. Is there a native way to do this in VB.NET?
1
2357
by: Oberfuhrer | last post by:
Hello all VB.net friends ! i have done most of my programming in assembly, at least so far. Recently i decided to learn a high level language for windows programming. I didnt take long to realize that VB.net would be my perfect friend. I have already rewritten most of my assembly controls in VB, but i am not satiesfied with the scrolling performance, though. In assembler, where you can write directly to the video memory, this
6
1550
by: Jon Paal | last post by:
an excellent working solution for scrolling tables appears at this link http://www.litotes.demon.co.uk/example_scripts/tableScroll.html author has no contact page, but I have a question about the display of the table. the top left corner in the table grid is hidden from being displayed. I have tried to figure out where it is being hidden but can't find the code to allow it to be shown as part of the left frozen column. can anyone...
12
1805
by: Jon Paal | last post by:
trying to use this script for scrolling tables found at this link: http://www.litotes.demon.co.uk/example_scripts/tableScroll.html The top left corner in the table grid is hidden from being displayed. I see: -- the code is creating DIV's and -- overrides are hidden
3
2719
by: Brian Tkatch | last post by:
I have a form with two DataGrids, which are kept in sync manually via Stored PROCEDURE calls. That is, when a record is selected on the first grid, a stored PROCEDURE is CALLed to Fill() the next second DataGrid's DataSource. All that works very well. And, when there are no records to display, it is simply left blank. My issue is that when i scroll the first one, sometimes the second grid shows a bunch of null values (a "new" record). ...
3
3449
by: AngryHank | last post by:
I am sure I am not typing the correct question in Google or this group to find the answer to my question. So, I have to ask. I have a scrolling div that I am changing text color and background color on a mouse over of a marker on a map. I also want the div with the proper ID to come to the viewable area of the scrolling div when I mouse over the marker on the map. I have that working in IE but not Firefox.
5
4267
by: PythonistL | last post by:
I am a newbie with Javascript. I have this simple script for scrolling text <HTML> <HEAD> <TITLE>Scrolling Message Script</TITLE> <SCRIPT language="JavaScript"><!-- var msg = 'My scrolling text.. ' function scrollMsg(){
0
10257
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...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10037
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
9904
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
8931
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
7456
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
5354
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
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

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.