[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
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.
  • @ QM|T:
    hahah nice
  • @ lurch6661:
    iam usually up early time alone hahahhhaah
  • @ lurch6661:
    gives me time to smoke more
  • @ lurch6661:
    gf smokes but ot like lurch lol
  • @ QM|T:
    haha more lol
  • @ QM|T:
    hahaha
  • @ lurch6661:
    lol
  • @ lurch6661:
    bt yea that emulator is pretty cool
  • @ lurch6661:
    i was trying to install it then i figured whats the point lol
  • @ lurch6661:
    you can even run it on linux
  • @ QM|T:
    cool
  • @ lurch6661:
    theres gotta be a way to run that emulator on a ps4 linux with a webkit
  • @ QM|T:
    im going to clean the house
  • @ QM|T:
    yea think so google it bro
  • @ lurch6661:
    ok bro tc and zap
    +1
  • Chat Bot:
    jun88v4mobi is our newest member. Welcome!
  • Chat Bot:
    ANGUS0023233 has joined the room.
  • Chat Bot:
    Transformers1k is our newest member. Welcome!
  • Chat Bot:
    cakhiazae is our newest member. Welcome!
  • Chat Bot:
    tintucsanta is our newest member. Welcome!
  • Chat Bot:
    zgsx888com is our newest member. Welcome!
  • Chat Bot:
    vx88ltd2 is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    Connor Tyndall is our newest member. Welcome!
  • Chat Bot:
      Chat Bot: Connor Tyndall has posted a new reply in the thread "James Reborn v40.1(1.7.4) ModLoader CFW/HEN".