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
Contributors
User avatar
applezoom
New Member
New Member
Posts: 10
Joined: Thu Apr 12, 2012 12:31 am

ProgressBar(Cool Way)
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
Image
:3
ROBLOX
User avatar
applezoom
New Member
New Member
Posts: 10
Joined: Thu Apr 12, 2012 12:31 am

Re: ProgressBar(Cool Way)
applezoom
Hope You Like It




ROBLOX Name:applezoom
Image
:3
ROBLOX
User avatar
polas
New Member
New Member
Posts: 13
Joined: Sun Dec 20, 2009 6:32 pm

Re: ProgressBar(Cool Way)
polas
How to run a program without using the timer ?
Only using thread.
User avatar
XTechVB
VIP - Site Partner
VIP - Site Partner
Posts: 727
Joined: Thu May 20, 2010 10:32 am

Re: ProgressBar(Cool Way)
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 :)
You can find me on Facebook or on Skype mihai_92b
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Re: ProgressBar(Cool Way)
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;
5 posts Page 1 of 1
Return to “Tutorials”