A Revolution
From the Norm,
Towards Greatness
Home » » Visual Basic: Basic Progressbar (Buttons + Timer)

Visual Basic: Basic Progressbar (Buttons + Timer)

Written By Unknown on Tuesday, May 24, 2016 | 3:24 PM

Visual Basic: Basic Progressbar (Buttons + Timer)

Welcome to today's blog post and vLog for programming tutorials. Today we are going to learn how to create a very simple progress bar in Visual Basic, and it will also introduce you to some key items that will be building up to the advanced progress bar tutorial. 

For this tutorial you are going to need, 
  1. Button1 - "Start"
  2. Button2 - "Stop"
  3. Timer1 
  4. ProgressBar1 
You can setup your form the same way I have it above in the header image, or however you would like it to be. To learn more about this tutorial, watch my YouTube video below to see the step by step or simply grab the source code below the video itself. 

  1. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  2.         'start
  3.        Timer1.Start()
  5.     End Sub
  7.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  8.         'stop
  9.        Timer1.Stop()
  11.     End Sub
  13.     Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
  14.         ProgressBar1.Increment(+1)
  16.         If (ProgressBar1.Value = 100) Then
  18.             If (CheckBox1.Checked = TrueThen
  19.                 Timer1.Stop()
  20.                 ProgressBar1.Value = 0
  21.             End If
  22.         End If
  24.     End Sub

That is all for today,
hope you enjoyed this tutorial. 


About Unknown


Post a Comment