ProgressBar(Cool Way)
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
5 posts
Page 1 of 1
Needed:
Picturebox
2 Timers Timer2 = Enabled Timer1 = Disabled
Picturebox
2 Timers Timer2 = Enabled Timer1 = Disabled
Code: Select all
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
PictureBox1.Width += 1
End Sub
Private Sub Timer2_Tick(sender As System.Object, e As System.EventArgs) Handles Timer2.Tick
If PictureBox1.Width = 300 Then
Timer1.Stop()
End If
End Sub
End Class
Look i don't want to be rude but.. what progressbar? this is just an image which changes it's width using a timer! There's no increment, no value, no minimum, no maximum, nothing.
But i appreciate the effort you put in writing this
But i appreciate the effort you put in writing this

You can find me on Facebook or on Skype mihai_92b
polas wrote:How to run a program without using the timer ?That's why #XTechVB is saying this isn't really a progressbar.
Only using thread.
To use this without a timer, you would need to have a variable for maximum and value, and adjust the width of the image according the the value/maximum ratio.
Kinda like this:
Code: Select all
Then the picturebox's width is a certain fraction of it's maximum width, depending on the value and the maximum cooll;Dim v, max, max_width As Integer
v = 50
max = 100
max_width = 250
PictureBox1.Width = v/max * max_width
5 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023