Drag0n Posted March 8, 2009 Author Share Posted March 8, 2009 Okay. If I have this code:```Private Sub Timer1_Timer()Label1.Caption = Format(Val(Label1.Caption) + 0.01, _"fixed")LoopEnd Sub```and then this code:```Private Sub Command1_Click()Call Timer1_TimerEnd Sub```Anything wrong with that? I dunno how to start the timer.. Link to comment Share on other sites More sharing options...
unnown Posted March 9, 2009 Share Posted March 9, 2009 timer1.enabled = trueworks better :) Link to comment Share on other sites More sharing options...
Drag0n Posted March 9, 2009 Author Share Posted March 9, 2009 So like..```Private Sub Command1_Click()Timer1.enabled = TrueEnd Sub```?No that didn't work. Link to comment Share on other sites More sharing options...
unnown Posted March 9, 2009 Share Posted March 9, 2009 yeah that should work :) Link to comment Share on other sites More sharing options...
Drag0n Posted March 9, 2009 Author Share Posted March 9, 2009 It doesn't.. sorry for bugging you lol. here I'll post it as an attachment.Nah I'll pm it to you. Link to comment Share on other sites More sharing options...
unnown Posted March 9, 2009 Share Posted March 9, 2009 Private Sub Timer1_Timer()Label1.Caption = Format(Val(Label1.Caption) + 0.01, _"fixed")End Subwhy did you add the loop? not needed :) Link to comment Share on other sites More sharing options...
Drag0n Posted March 9, 2009 Author Share Posted March 9, 2009 Still doesn't work..here's entire code```'Resets timerPrivate Sub Command4_Click()Label1.Caption = ""End Sub'IS the timerPrivate Sub Timer1_Timer()Label1.Caption = Format(Val(Label1.Caption) + 0.01, _"fixed")End Sub'Starts the timerPrivate Sub Command1_Click()Timer1.Enabled = TrueCall Timer1_TimerEnd Sub'Pauses the timerPrivate Sub Command2_Click()timer1_enabled = FalseStop Timer1_TimerEnd Sub``` Link to comment Share on other sites More sharing options...
unnown Posted March 9, 2009 Share Posted March 9, 2009 Private Sub Command1_Click()Timer1.Enabled = TrueEnd Sub'Pauses the timerPrivate Sub Command2_Click()Timer1.enabled = FalseEnd Subthat should work, otherwise the stuff in the timer is wrong,or the timers propertiesalso try just this as your timerPrivate Sub Timer1_Timer()Label1.Caption = "THANKS UNNOWN"End Sub Link to comment Share on other sites More sharing options...
Drag0n Posted March 9, 2009 Author Share Posted March 9, 2009 Let me get it straight. When I press Command1 ("Start") it goes up 0.01 then nothing happens. If I press it again it goes to 0.02\. Is there a way to continually add 0.01 until someone presses stop? like a stopwatch? Link to comment Share on other sites More sharing options...
Drag0n Posted March 9, 2009 Author Share Posted March 9, 2009 When I click using your code nothing happens. when I click using my code it goes up + 0.01. Link to comment Share on other sites More sharing options...
unnown Posted March 9, 2009 Share Posted March 9, 2009 check the properties of the timer, something is wrong there :) Link to comment Share on other sites More sharing options...
Drag0n Posted March 9, 2009 Author Share Posted March 9, 2009 Ok.. Link to comment Share on other sites More sharing options...
Drag0n Posted March 9, 2009 Author Share Posted March 9, 2009 haha! thanks Unnown! it works, I just needed to set the interval to 1. Link to comment Share on other sites More sharing options...
unnown Posted March 9, 2009 Share Posted March 9, 2009 good :Dalso use this codePrivate Sub Command1_Click()Timer1.Enabled = TrueEnd Sub'Pauses the timerPrivate Sub Command2_Click()Timer1.enabled = FalseEnd Sub Link to comment Share on other sites More sharing options...
Drag0n Posted March 10, 2009 Author Share Posted March 10, 2009 That automatically starts the timer when I open the .exe.. is there any way to make it start on "Startbtn1" command? Link to comment Share on other sites More sharing options...
unnown Posted March 10, 2009 Share Posted March 10, 2009 set enabled to false in properties Link to comment Share on other sites More sharing options...
Drag0n Posted March 10, 2009 Author Share Posted March 10, 2009 Thanks Unnown, thanks all. Got it to work now.:D Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now