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

Determine when mousewheel stops moving?

In a database search application (vb2005), the user wants to be able to
scroll through records using the mousewheel. The data display form contains
textboxes for the main data and a datagridview for the detail data for each
main record. The form also contains btnBegining, btnPrevious, btnNext,
btnEnd.

In the btnNext.MouseWheel event I can increment/decrement the main data
currencymanager position of the main dataset (depending on e.Delta of the
mousewheel event - pos/neg value). If I increment/decrement the
currencyManager.Position the textboxes on the form populate with the
corresponding record's data (textboxes are bound to the dataset.Table). But
I have to load the detail data for each record separately - I am not pulling
and storing all the detail data for the maindata (too much data). So each
time the mousewheel rolls - I increment currencyManager.Position +=1 and I
call another proc to load the detail data per a recordID. This works fine.

My problem is that I also have to load some other stuff when a desired
record is retrieved. Rather than calling a bunch of procs for each click of
the mousewheel, I only increment/decrement the currencyManager.Position and
load the Detail data for each record. What I want to do is when the
mousewheel stops moving for say 500 ms, call the other procs.

I have a similar routine for holding down btnNext.KeyDown. It cycles
through records in a loop. On the KeyUp event I set a flag to get out of the
loop and the rest of the procs run. I want to do the same thing with the
mousewheel event. But how do I detect when the mousewheel stops moving?
What event can I use to set a flag that the mousewheel has stopped moving to
run the rest of the procs? I am thinking something like Thread.Sleep(500),
but I don't think I want to add that to the Mousewheel event.

Any suggestions appreciated.

Thanks,
Rich
Mar 22 '07 #1
1 2445
One thought I have on this issue is to use a Timer object to poll when the
mouseWheel stops moving by constantly read the e.Delta values, but now I will
need to use a Delegate I think for the Timer object to be able to communicate
with the MouseWheel event. Anyway, it is just a thought.

Any suggestions appreciated if I am going in the right dirrection, and how I
might implement the Delegate.
"Rich" wrote:
In a database search application (vb2005), the user wants to be able to
scroll through records using the mousewheel. The data display form contains
textboxes for the main data and a datagridview for the detail data for each
main record. The form also contains btnBegining, btnPrevious, btnNext,
btnEnd.

In the btnNext.MouseWheel event I can increment/decrement the main data
currencymanager position of the main dataset (depending on e.Delta of the
mousewheel event - pos/neg value). If I increment/decrement the
currencyManager.Position the textboxes on the form populate with the
corresponding record's data (textboxes are bound to the dataset.Table). But
I have to load the detail data for each record separately - I am not pulling
and storing all the detail data for the maindata (too much data). So each
time the mousewheel rolls - I increment currencyManager.Position +=1 and I
call another proc to load the detail data per a recordID. This works fine.

My problem is that I also have to load some other stuff when a desired
record is retrieved. Rather than calling a bunch of procs for each click of
the mousewheel, I only increment/decrement the currencyManager.Position and
load the Detail data for each record. What I want to do is when the
mousewheel stops moving for say 500 ms, call the other procs.

I have a similar routine for holding down btnNext.KeyDown. It cycles
through records in a loop. On the KeyUp event I set a flag to get out of the
loop and the rest of the procs run. I want to do the same thing with the
mousewheel event. But how do I detect when the mousewheel stops moving?
What event can I use to set a flag that the mousewheel has stopped moving to
run the rest of the procs? I am thinking something like Thread.Sleep(500),
but I don't think I want to add that to the Mousewheel event.

Any suggestions appreciated.

Thanks,
Rich
Mar 22 '07 #2

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

Similar topics

18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
6
by: deko | last post by:
Is it possible to disable the mouse wheel WITHOUT using a DLL? I've looked at Microsoft Knowledge Base Article 278379 (http://support.microsoft.com/default.aspx?scid=kb;en-us;278379), which...
2
by: Jack | last post by:
Hi all, I searched the archives and found everyone happy with Stephen's MouseWheel On/Off code except for those with subforms. Stephen's page indicates that he has added code to handle subforms...
0
by: Mark Johnson | last post by:
Seems the mousewheel isn't controlled in earlier versions like A97 or 2000. So you can accidentally use the mousewheel to scroll to the next record in an unbound form. And that can cause Access to...
7
by: Daisy | last post by:
I've got a control with a scrollbar docked to the right-hand side. The scrollbar works fine, I've got an event: bottomControlVScroll.Scroll += new ScrollEventHandler(HandleBottomThingScroll); ...
3
by: Just Me | last post by:
If I move the mouse cursor over a control and stop moving I get a MouseHover event. If I then move the cursor while staying within the control and then stop moving I do not get another...
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...
3
by: Dave K | last post by:
I seem to be missing something... I want to use a mousewheel event in my VB.NET app... and there's a lot of example code on the net showing how to use the mousewheel event... and the .NET docs...
6
by: Bob Johnson | last post by:
How can I programmatically determine when a MDI child form has been dragged from one location to another within its MDI parent form? Ideally I'd like to trap some event that occurs when the...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...
0
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...

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.