Page 1 of 1

ProgressBar(Cool Way)

Posted: Fri May 04, 2012 1:29 am
by applezoom
Needed:
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

Re: ProgressBar(Cool Way)

Posted: Fri May 04, 2012 10:54 pm
by applezoom
Hope You Like It




ROBLOX Name:applezoom

Re: ProgressBar(Cool Way)

Posted: Tue Feb 25, 2014 3:36 pm
by polas
How to run a program without using the timer ?
Only using thread.

Re: ProgressBar(Cool Way)

Posted: Tue Feb 25, 2014 4:30 pm
by XTechVB
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 :)

Re: ProgressBar(Cool Way)

Posted: Tue Feb 25, 2014 4:55 pm
by comathi
polas wrote:
How to run a program without using the timer ?
Only using thread.
That's why #XTechVB is saying this isn't really a progressbar.

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
Dim v, max, max_width As Integer

v = 50
max = 100
max_width = 250

PictureBox1.Width = v/max * max_width
Then the picturebox's width is a certain fraction of it's maximum width, depending on the value and the maximum cooll;