borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (AddCustomToolTip)Next Topic (Very Important problem in OCX & Resource (plzzzzzzzzzzzzzzzzzzzzz)) New Topic New Poll Post Reply
AndreaVB Forum : VB General : repeat/hold button?
Poster Message
x-shooter
Level: Whizz Kid

Registered: 24-01-2005
Posts: 16

icon repeat/hold button?

I'm looking for a button that when I push the button and hold that button some kind of timer or volume will in- / decrease for aslong as I hold that button.

Who can help me?

[Edited by x-shooter on 22-02-2005 at 08:19 PM GMT]

22-02-2005 at 07:56 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: repeat/hold button?

In Command1_Mouse_Down() event start the timer, and in Comman1_Mouse_Up event calculate the time elapsed.

____________________________
If you find the answer helpful, please mark this topic as solved.

22-02-2005 at 10:03 PM
View Profile Send Email to User Show All Posts | Quote Reply
humberto
Level: VB Lord

Registered: 13-01-2005
Posts: 246
icon Re: repeat/hold button?


dim d%

Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Dim t#
Static a%

    d = True
    Do While d
        a = a + 1
        Text3 = a
        t = Timer
        Do While Timer - t < 0.25
           DoEvents
        Loop
    Loop
    
End Sub

Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
    d = False
End Sub

23-02-2005 at 07:14 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : repeat/hold button?
Previous Topic (AddCustomToolTip)Next Topic (Very Important problem in OCX & Resource (plzzzzzzzzzzzzzzzzzzzzz)) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder