[VB.NET] Making a Countdown

  • Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

1UP

Member
Oct 9, 2014
24
10
63
Well this was something is something from a program I wrote years back. Basically the user would put in a number and the program would then convert it to seconds and then begin the count down.

So to get this started, either drag a timer control over to your form or create one through code(not going to be going over this one)

Let's take what the use put in the textbox and convert it to seconds
(This program was based on hours)

Code:
 Private Sub btn_start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_start.Click
  Dim time As String

time = txt_time.Text * 3600
txt_time.Text = time
timer1.enabled =true
 End Sub
I coded things wierd years ago, so you could pretty much do this a better way, but I'm just coping and pasting what I had.




In the timer_tick proceedure we are going to do this:

Code:
 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
   
  txt_time.Text = myTime - 1
  myTime = txt_time.Text
  If txt_time.Text= 0 Then
  'Insert event here
  Next
  End If
  End Sub
 
  • Like
Reactions: Elite_Modz

Irving

ConsoleCrunch Addict
Community Veteran
Determined Poster
Active Member
Console ID Poster
Oct 6, 2013
2,642
1,390
300
Console Crunch
Well this was something is something from a program I wrote years back. Basically the user would put in a number and the program would then convert it to seconds and then begin the count down.

So to get this started, either drag a timer control over to your form or create one through code(not going to be going over this one)

Let's take what the use put in the textbox and convert it to seconds
(This program was based on hours)

Code:
Private Sub btn_start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_start.Click
  Dim time As String

time = txt_time.Text * 3600
txt_time.Text = time
timer1.enabled =true
End Sub
I coded things wierd years ago, so you could pretty much do this a better way, but I'm just coping and pasting what I had.




In the timer_tick proceedure we are going to do this:

Code:
 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  
  txt_time.Text = myTime - 1
  myTime = txt_time.Text
  If txt_time.Text= 0 Then
  'Insert event here
  Next
  End If
  End Sub
Damn keep up the good work.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • @ EMRR:
    Can you help me?
  • @ QM|T_JinX:
    het bro nice work man
  • @ QM|T_JinX:
    with ?
  • @ EMRR:
    What do you mean? I can't understand "with ?"
  • @ QM|T_JinX:
    you ask can you help me and i said with what can i help you out
  • @ EMRR:
    Can you help me about share my generated CID's? Where can i share it on this website?
  • @ QM|T_JinX:
    you can put it in cid section or ps3 section in general
  • @ EMRR:
    Ok, thanks :)
  • @ QM|T_JinX:
    np bro
  • Chat Bot:
    EMRR has started a new thread called "Working Console ID" in Console ID's.
  • Chat Bot:
    EMRR has started a new thread called "Console ID 1" in Console ID's.
  • Chat Bot:
    wadu is our newest member. Welcome!
  • Chat Bot:
    EMRR has started a new thread called "Console ID 2" in Console ID's.
  • Chat Bot:
    QM|T_JinX has posted a new reply in the thread "Console ID 2".
  • @ lurch6661:
    gold hen out soon
  • Chat Bot:
    Christo has joined the room.
  • @ lurch6661:
    zap
  • @ lurch6661:
    trying to figure out how to run a rpf files
  • @ lurch6661:
    on gta5
  • @ lurch6661:
    i guess there is a way were you can upload real cars \
  • @ QM|T_JinX:
    rpf is a update like / update.rpf
  • @ lurch6661:
    also i cant find dmz
  • @ lurch6661:
    is that not warzone
    @ lurch6661: is that not warzone