|
-
Dec 3rd, 2001, 07:16 AM
#1
Thread Starter
Fanatic Member
When MouseButton Down then repeat action until MouseButton released
MouseDown.
I want to skip the records with the Mouse. This is no Problem, but i have to click for every Record again. I want to press the MouseButton and as long as i dont release the Button the Records have to skip (the Sub have to be called again).
A sample sourcecode would be very nice .....
I would be VERY happy if an expert here can answer this questions.
Nice greetings from Bangkok
-
Dec 3rd, 2001, 07:17 AM
#2
-= B u g S l a y e r =-
what control are u using to navigate ? a command button or a datacontrol directly ?
-
Dec 3rd, 2001, 07:25 AM
#3
Thread Starter
Fanatic Member
i want to click on a command button
Hi, thanks for your fast answer,
i want to click on a commend button that have behind a sourcecode to skip records.
But i am generally interested how to handle it if i click on any kind of button to repeat the action.
-
Dec 3rd, 2001, 07:25 AM
#4
This assumes that you have code to display your records as they are moving along, and that you have a recordset of the records that you want displayed. It also assumes you are using a command button to zip throught the recordset. Something like this should work for you.
VB Code:
Option Explicit
Private StopIt As Boolean
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Do While StopIt = False
Rs.MoveNext
Loop
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
StopIt = True
End Sub
-
Dec 3rd, 2001, 07:26 AM
#5
-= B u g S l a y e r =-
wow Hack, u'r on a roll today
-
Dec 5th, 2001, 07:47 AM
#6
Thread Starter
Fanatic Member
Thanks Hack,
Hi,
unfortunatly the repeat is so fast that i cant use it. I would like to skip records in this way.
But with this repeat it needs only 1 second to skip 1000 records, hehe.
You got any idea, how i make it that i can skip continiously records, but not to fast?
-
Dec 5th, 2001, 07:51 AM
#7
Conquistador
DoEvents
or Sleep or wait or something
-
Dec 5th, 2001, 08:00 AM
#8
Are there any sequential numbers involved in your records, like an index starting at 1 and going to the last record in the Db? My thought is that if you have records somehow numbered from 1 to say 10,000 then you could move directly to a specified record number, and on the next click, add a 1000 to the record number you are on now, and move directly to it.
-
Jan 1st, 2002, 12:28 AM
#9
Thread Starter
Fanatic Member
Hi
There is an index on the records and they are around 1000.
All what i want is that the user don't have to release always the mous button when he skip records. It is much more comfortable to hold the button down until he comes to this area where he want to go. But the speed is to fast for it. It needs less then 1 second to go through the records and on the screen is no update to see when he skip the records.
Any idea how to solve this problem that the records get skipped by holding down the button in a reasonable speed?
I would be very happy if somebody know it.
Franky
Happy new year to you
-
Jan 1st, 2002, 10:35 AM
#10
You could try putting the rs.NoveNext method inside a timer event set the intervals to whatever speed you want. In the mouse down event of the command button, enable the timer. In the mouse up event disable the timer.
-
Jan 1st, 2002, 01:12 PM
#11
Hyperactive Member
Look at this Hack code modification to see if it does what you want
VB Code:
Public Declare Function GetTickCount Lib "kernel32" () As Long
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim TimeDelay As Integer
Dim Start As Long
TimeDelay = 500 ' half second
Start = GetTickCount
Do While StopIt = False
DoEvents
If GetTickCount > Start + TimeDelay Then
Rs.MoveNext
Start = GetTickCount
End If
Loop
End Sub
-
Jan 1st, 2002, 01:24 PM
#12
PowerPoster
Use this Pause Sub. interval is from 0.0001 all the way up to a whole day heh.
Sub Pause(interval)
current = Timer
Do While Timer - current < Val(interval)
DoEvents
Loop
End Sub
Dim StopLoop as Boolean
-------------------------------------------------------------------------
Mouse_Down
StopLoop=False
Do Until StopLoop= True
Pause(0.1)
'More Code
Loop
-------------------------------------------------------------------------
Mouse_Up
StopLoop=True
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Jan 1st, 2002, 01:31 PM
#13
VB Code:
Option Explicit
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer1.Enabled = True
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Timer1.Interval = 200
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
rs.MoveNext
End Sub
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
|