|
-
Oct 4th, 2000, 10:35 AM
#1
Thread Starter
Frenzied Member
Hi,
I want to be able to hold a command button down and have it loop through the click event code so the user can easily scroll through the records..
For example, the code behind the Command1_Click is:
Code:
'-- navigate selected items
Select Case Index
Case 0: 'move backward
If x = 0 Then Exit Sub
x = x - 1
PopulateItem x
Case 1: 'move forward
If x + 1 = nCnt Then Exit Sub
x = x + 1
PopulateItem x
End Select
I would want to be able to hold the button down and have it loop through the above code..
Thanks,
Dan
-
Oct 4th, 2000, 10:42 AM
#2
Fanatic Member
-
Oct 4th, 2000, 10:51 AM
#3
-
Oct 4th, 2000, 10:56 AM
#4
Fanatic Member
Just make sure to include the DoEvent or else ur program will freeze!
ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet? 
-
Oct 4th, 2000, 11:39 AM
#5
Thread Starter
Frenzied Member
kayoca,
Thanks for the code.. Works great but I would like to expand on your code a little..
I would like to add 2 things which I don't know how to do..
1) Put some sort of delay in the loop so that I can control the speed of the loop.. It scrolls way to fast as it is.. I would like to be able to change the value of the delay so I can play around with the speed of the loop.
2) I don't want the looping action to occur right away. I would like there to be about a 1 or 2 second delay so that if the user just "clicks" the button, it only increments 1 at a time.. But, if the user holds the button for more than a second, the looping action occurs..
Any ideas?
thanks,
Dan
-
Oct 4th, 2000, 01:06 PM
#6
Addicted Member
For the advance step by step, I would use the Click event as you would normally. As far as delaying or make the speed progressively increase, I would just use a timer.
The MouseDown would enable the timer and the MouseUp would disable it. Use an integer (or long) to keep track of how many times the Timer event fired. Based on that value, you can vary the the Interval of your timer.
I never tried that but it should work.... let me know...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|