|
-
Jan 12th, 2001, 02:42 PM
#1
I want an action to repeat while the left mouse button is held down over an image box (like the way that you hold rewind on media player and it rewinds). Does anyone know how i would do this?
-
Jan 12th, 2001, 03:32 PM
#2
Code:
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Print "Rewinding..."
End Sub
-
Jan 12th, 2001, 03:36 PM
#3
Actually, that will not continuously repeat the event. If you want to do so then use this code instead.
Add to a form with a Timer and an Image.
Code:
Private Sub Form_Load()
Timer1.Interval = 100
Timer1.Enabled = False
End Sub
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Timer1.Enabled = True
End Sub
Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Print "Rewinding..."
End Sub
-
Jan 12th, 2001, 05:55 PM
#4
Thanks a lot it worked great!
-
Jan 13th, 2001, 07:03 AM
#5
transcendental analytic
Here's another method you could use, wihtout having to use a timer control, so you can have more control over the "rewinding" processs...
Code:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Do While GetAsyncKeyState(1)
Caption = "Rewinding"
'do your rewinding here
DoEvents
Loop
Caption = "Paused"
End Sub
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jan 13th, 2001, 05:21 PM
#6
I wondered if there were any activex controls or anything which make cool buttons like office toolbars (if you know what i mean)
-
Jan 13th, 2001, 06:32 PM
#7
transcendental analytic
go look at my homepage
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|