By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,960 Members | 2,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,960 IT Pros & Developers. It's quick & easy.

Determine when mousewheel stops moving?

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.