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

scrollbar.scroll event occuring twice

I am curious as to why the scrollbar.scroll event gets called twice

Here is an example of my code
Private Sub vsbMoveCar_Scroll(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.ScrollEventArgs) Handles vsbMoveCar.Scrol
'Position the up and down movemen
'Used when the scroll box is move

picCar.Top = vsbMoveCar.Valu
X +=
Label1.Text = CStr(X

End Su

When I click on the scrollbar X gets incremented twice. Why is this event being called twice? I would greatly appreciate some insight into this

I know that there is a keydown and keyup event, but I don't think this is what's doing it.

Nov 20 '05 #1
1 3357
Check the type member of the ScrollEventArgs variable. It will be one of the
ScrollEventType members such as LargeIncrement, SmallIncrement, EndScroll,
etc. I suspect that you are getting an EndScroll message sent after the
Increment/Decrement message. Simply check to see that the type is indicating
that a scrollbar movement actually occurred and that it's not signalling the
end of the movement.

Scott
"johnperkins" <an*******@discussions.microsoft.com> wrote in message
news:CD**********************************@microsof t.com...
I am curious as to why the scrollbar.scroll event gets called twice.

Here is an example of my code:
Private Sub vsbMoveCar_Scroll(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.ScrollEventArgs) Handles vsbMoveCar.Scroll 'Position the up and down movement
'Used when the scroll box is moved

picCar.Top = vsbMoveCar.Value
X += 1
Label1.Text = CStr(X)
End Sub

When I click on the scrollbar X gets incremented twice. Why is this event being called twice? I would greatly appreciate some insight into this.
I know that there is a keydown and keyup event, but I don't think this is what's doing it.

Nov 20 '05 #2

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

Similar topics

4
by: Ross | last post by:
I have been using the following script to return a scrollbar to the position it was in before the data was posted. It works in ie but not in firefox. Thanks, R. <script...
22
by: Colin McGuire | last post by:
I apologize for posting yet another scrollbar question. Here is my code. All I want is for a diagonal line to appear from coordinates (0,0) to (width,height) in a usercontrol regardless of whether...
1
by: Nicholas Shewmaker | last post by:
(I apologize if this posts twice. My AVG is being fussy.) From what I've read, MouseWheel is a very tricky event. I have replaced my Python tcl84.dll and tk84.dll files with those in the...
7
by: Pachydermitis | last post by:
Hi all you Experts, I need to scroll a listbox horizontally. For the life of me I cannot get it to move. I can successfully scroll it vertically. I have the handle for the listbox and the scroll...
2
by: Ahmad Jalil Qarshi | last post by:
Hi! I am making an application and need to capture the event when RichTexBox control's vertical scrollbar's values changes. There is an event named VScroll but it is fired when mouse is ...
6
by: Steve Barnett | last post by:
I think I'm going nuts... Put a scroll bar control on a form and in the form_load method, initialise it as follows: vScrollBar.Minimum = 0; vScrollBar.Maximum = 10; vScrollBar.SmallChange = 1;...
3
by: jkarpago | last post by:
Hi: I have a javascript that creates a custom scrollbar for a div in the middle of my page. The problem is that when I scroll in my div it scrolls the div and the scroll of the page so I loose...
2
by: Rich | last post by:
Hello, Some database applicatins have a tooltip feature where when you are dragging the scrollbar of the table view a tooltip appears next to the mouse cursor displaying the approximate record...
0
by: =?Utf-8?B?c2RhbmllbEBhaWc=?= | last post by:
I am having some issues with the standard Windows scrollbar. I am using MS Visual Studio 2005. Code is C#. The application is a Windows Forms app. The tool is a vertical scroll bar from the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...

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.