i have a progress bar and a button named Scan ian i want it to scan so the progress bar works :confused:
and none of the book i read sayed anything about it
Printable View
i have a progress bar and a button named Scan ian i want it to scan so the progress bar works :confused:
and none of the book i read sayed anything about it
what i do is a progress bar.. i divide the number of events or w/e im doing into a hundred... and each time each event is done just do soemthing live
Progressbar.value += 4
is this what you meant?
A ProgressBar is supposed to indicate the progress of something. What is it that you're attempting to indicate the progress of? If you have a task that is broken into a set number of subtasks and each of these is given equal weighting in the progress then you would set the Maximum to the number of tasks, the Step to 1 and then call PerformStep each time you want to advance the progress. If you have multiple subtasks that have unequal weighting then you'd do something like what c0rrupt suggested. If you don't know exactly how much or how long processing will occur then you can't really do either of these things. If you're using VB 2005 then you set the Style of the ProgressBar to Marquee and it will just animate indefinitely until you stop it.
no i need a code for aprogress bar so it will move
Hi Sean,Quote:
Originally Posted by SeanTVoth
Here's an example for a progressBar.
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ProgressBar1.Value = 1 ProgressBar1.Visible = True Timer1.Enabled = True End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ProgressBar1.Value = ProgressBar1.Value + 1 If ProgressBar1.Value >= 10 Then Timer1.Enabled = False ProgressBar1.Visible = False End If End Sub
I hope it's a start,
sparrow1
thanks now is there a way when the progessbar is done then a message box wil pop up
Yes there's a possibility:Quote:
Originally Posted by SeanTVoth
VB Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ProgressBar1.Value = ProgressBar1.Value + 1 If ProgressBar1.Value >= 10 Then Timer1.Enabled = False ProgressBar1.Visible = False MsgBox("The progressBar has stopt") End If End Sub
Wkr,
sparrow1
i have a button and i need it to pause the progessbar
When you Click the button just Stop the Timer.Quote:
Originally Posted by SeanTVoth
Hi,Quote:
Originally Posted by SeanTVoth
Like jm said;
VB Code:
Timer.Enable = False
Wkr,
sparrow1