Countdown from 10 to 0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ahoway
    New Member
    • Nov 2006
    • 13

    Countdown from 10 to 0

    I am trying to implement a countdown which will count down from 10 to 0 (seconds). I have been using integers, but the count down is to fast to display.

    [code=vbnet]
    Private Sub startButton_Cli ck(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles startButton.Cli ck
    Dim secondsInteger As Integer
    '


    PictureBox1.Vis ible = True
    Label1.Visible = True

    secondsInteger = 10

    Do Until secondsInteger = 0
    secondsInteger = secondsInteger - 1
    countDownTextBo x.Text = secondsInteger. ToString("")



    Loop

    If secondsInteger = 0 Then
    PictureBox2.Sho w()
    End If[/code]
    Last edited by Frinavale; Nov 15 '07, 07:55 PM. Reason: Added [code] tags
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Better put the code in a timer event.

    Comment

    • hemantpatil
      New Member
      • Nov 2007
      • 8

      #3
      use the timer tick event it give fast perperformence

      Comment

      Working...