954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Timer Control Question

I am a novice at VB.Net. I am using Microsoft Visual Basic 2005 Express Edition. I designed a very basic splash screen. I am using the timer control to display the splash screen for only 5 seconds. I need the number of seconds left to be displayed on the splash screen before it closes. Basically a countdown from 5 to 1. How do I do this? Is there a way to make the timer control visable on the form and that will create my desired effect? Please help me. Thanks

slater619
Newbie Poster
1 post since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

use timer & progress bar.

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        ProgressBar1.Value += 1

        If ProgressBar1.Value <= 20 Then

            Label1.Text = "5"

        ElseIf ProgressBar1.Value <= 40 Then

            Label1.Text = "4"

        ElseIf ProgressBar1.Value <= 60 Then

            Label1.Text = "3"

        ElseIf ProgressBar1.Value <= 80 Then

            Label1.Text = "2"

        ElseIf ProgressBar1.Value <= 99 Then

            Label1.Text = "1"
        End If
        If ProgressBar1.Value = 100 Then
            Label1.Text = "Time's Up"
            Timer1.Dispose()
        End If
    End Sub
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You