Hi,
You shall catch the "Mouse Up" and "Mouse Down" events and add a timer in order to do that. To simulate your case I have added a vertical scroll bar and on click "Mouse Down" the value of the scroll bar will increase untill the button is released "Mouse Up". for testing this code just drop a command button, vertical scroll bar and a timer. Keep all the naming as it is and paste the below code in the code view.
Private Sub Form_Load()
Me.Timer1.Enabled = False
Me.Timer1.Interval = 10
End Sub
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Me.Timer1.Enabled = False Then Me.Timer1.Enabled = True
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
'Place your code for sending the signal here
Me.VScroll1 = Me.VScroll1 + 100
End Sub
Hope this works for you.
Enter your message below
Sign in or Join us (it's free).