[Question]CountDown - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19) +---- Thread: [Question]CountDown (/showthread.php?tid=4021) |
[Question]CountDown - p1g 0wnz - 12-28-2009 Ok, here is my countdown codes and pictures. Code: Public Class Form1 My point is. When i click Start, it FAST, very fast, what is the correct code to make it go slower? I did make some of that code up. Another question. When i press Stop, the time ends. Is there Anyway i could make it so it could start where i stoped it at? Oh yeah btw this took me about 10 minutes to do. I'm new to Visual Basic, so please don't make fun of this ;). RE: [Question]CountDown - Digital-Punk - 12-28-2009 @ ?1 set the timer interval in the timer1 properties to like 5000, that would be 5 seconds in milliseconds. @ ?2 what do you mean, like start the count of where the count left off at? RE: [Question]CountDown - p1g 0wnz - 12-29-2009 Ahh, Thanks for number 1, ill test it out.. In 2 i mean. It is counting like like from 100 It's now like 95 for example. I press stop.. And if i press start again it goes again to 100, unless i change it to 95.. And I hate constantly changing if i have to pause it /Stop it.. RE: [Question]CountDown - HatredTrinity - 12-29-2009 I'm assuming for number 2 you want to resume the countdown where it left off. In this case you should make a total of 3 buttons, Start, Pause/Resume (or Stop/Resume), and Reset. You want the Start button to obviously start the countdown. Now your Pause button will temporarily pause the countdown where its at AND it will resume your countdown. Your Reset button will turn the countdown off and reset it to 0(zero) for a new countdown. Ok, let's say your countdown Starts at 100, a few moments later its at....80. Now you want to hit the Pause/Resume button and it will "freeze" the time in its place. To have your Pause/Resume function to work properly I would suggest using a boolean. An example would be: Code: **NOTE** THIS IS C# SYNTAX WHICH IS VERY SIMILAR TO VB.NET I hope this help's you on your project! Please PM me if you need additional assistance. RE: [Question]CountDown - p1g 0wnz - 12-29-2009 algorithm Thank you so much for number 1. It worked perfectly for me ;). HatredTrinity Ok thanks ;). I will try it out. I hope it work. EDIT:: 2. Ok nothing seems to work. But if i make a new button named Resume for example. I put this code in timer1.stop() timer1.start() And when i press it. It stops for a second and start again where it started from... If i click like 10 times in row. It just is paused then i let go, it goes back.. So i kinda got the right code but i need to edit it somehow to make it i press once for pause and other one to resume it. RE: [Question]CountDown - thanasis2028 - 12-29-2009 Here is the correct code for the pause/resume button: Code: if timer1.enabled=true then RE: [Question]CountDown - p1g 0wnz - 12-29-2009 Thank you so much! Finally my countdown is perfect! Thanks to SF members . Tyvm guys all who helped. RE: [Question]CountDown - Digital-Punk - 12-29-2009 no problem anytime! |