473,761 Members | 6,563 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.MouseWh eel 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(50 0),
but I don't think I want to add that to the Mousewheel event.

Any suggestions appreciated.

Thanks,
Rich
Mar 22 '07 #1
1 2474
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.MouseWh eel 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(50 0),
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
2888
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 that applies to all these events, but I need to have specific code execute when the form closes. The properties for this method are sender (the originator) and e (event arguments). I know how to get typeof (sender) to determine what form or...
6
1010
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 explains how to create a DLL and implement code to disable the mouse wheel, as well as Mr. Lebans' code in MouseWheelHookA2K.zip (http://www.lebans.com/mousewheelonoff.htm), but both require a DLL. Sure, it's easy enough to run:
2
3003
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 ("Bug Fix for SubForms with ScrollBars. Bug fix for SubForms without visible ScrollBars.") - BUT I still can't get it to work on my app with my subforms. I'm using Access 2000, It works fine on the main forms but not on the
0
1925
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 hang-up, with an unbound form. I had this little popup box that was an alternative to editing text in a memo field. And every now and then I'd forget about the mousewheel problem and just habitually scrool as if editing in U-edit or something....
7
19997
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); Which calls this.Invalidate() on my control, and all is good. However, the MouseWheel does naff all. I understand this is probably because my mouse is over my control, and not the scrollbar. How can I set the MouseWheel event on my control to...
3
3036
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 MouseHover event. To get a Mousehover I must leave and reenter the control. I'd like to get an event each time the cursor stops moving.
1
11298
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 ActiveTcl distribution to fix the crashes caused by the event. Then, I managed to see that my test script (see code below) was registering the event by printing the delta value (+/- 120). ----------------- from Tkinter import *
3
3592
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 discuss the mousewheel event... but there doesn't seem to BE a mousewheel event. in VS 2003 or 2005, in C# or in VB.NET... and on the couple systems I've checked. I can't find a single control that gives me a "MouseWheel" event option in it's...
6
1338
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 dragging has stopped. Thanks.
0
9336
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9765
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
8770
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
7327
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
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5215
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
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.