Hey everyone, I would be happy if anyone knew the code to make a progressbar in VB 6.0 to work.. but not going so fast to finish.
Thanks for any answers
i am trying to create a database application but then am receiving an error message (method or data member not found). after that the '.Text' is selected to be corrected . the code is below
Please help I'm getting error while compile "Method or data member not found"
Dim i As Integer
Private Sub Timer1_Timer()
i = i + 1
ProgressBar1.Value = ProgressBar1.Value + 10
Select Case i
Case 1
Label5.Caption = "Loading Forms..."
Case 5
Label5.Caption = "Connecting Database..."
Case 12
Label5.Caption = "Preparing User Inteface..."
Case 17
Label5.Caption = "Checking Connectivity..."
Case 21
Label5.Caption = "Preparing Accounts Info..."
Case 23
Label5.Caption = "Preparations Complete!!!"
Timer1.Enabled = False
Unload Me
frmBlack.Show
frmRed.Show
End Select
End Sub
Private Sub Timer1_Timer()
Dim i As Integer
If ProgressBar1.Value >= ProgressBar1.Max Then
frmSign.Show
Unload Me
End If
i = i + 1
ProgressBar1.Value = ProgressBar1.Value + 1
Select Case i
Case 1
Label5.Caption = "LOADING FORMS."
Case 19
Label5.Caption = "CONNECTING DATABASE.."
Case 29
Label5.Caption = "PREPARING USER INTERFACE..."
Case 49
Label5.Caption = "CHECKING CONNECTIVITY."
Case 69
Label5.Caption = "PREPARING ACCOUNTS INFO.."
Case 95
Label5.Caption = "WELCOME (G.P.D.)"
Private Sub Form_Load()
ProgressBar1.Value = ProgressBar1.Value + 10
Label1.Caption = (ProgressBar1.Value / ProgressBar1.Max) * 100 & "%"
If ProgressBar1.Value = 98 Then
Unload Me
End If
End Sub
hey! this code ain't working in visual basic 6.0, there's semi colons in every line of a code, that's why i'm asking if this code is working only for vb.net???and if it's right, then, please give me some codes on how to use the progress bar in vb6.0,ok?thank...
Thank you very much for providing me with the progressive bar codes. It is working now perfectly. If I may ask once again. I have a database of some items. I wish as I scroll over the database, I be able to view its picture on the other side of the form. In other words, can I include images and view them individually withing a database record.
Thanks again for the good work you are doing for us.
i hope that you will also post or show the image of what is the overview of your created program so that user like me can imagine what it looks like.. thanks...
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If ProgressBar1.Value = 100 Then
Timer1.Enabled = False
MsgBox "Done :)"
Exit Sub
Else
ProgressBar1.Value = ProgressBar1.Value + 1
End If
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If Timer1.Enabled = True Then
ProgressBar1.Value = ProgressBar1.Value + 1
End If
If ProgressBar1.Value = 100 Then
Unload Me
Form2.Show
End If
End Sub
---------------------------
Ok Here , in coding.
if We input our coding with out form2 it gives us error.
We Must Hide or Exit form1 to run it correctly ...
---------------------------
Here i m Uploading an example.
http://www.2shared.com/file/11150640/587a6c3c/Prograss_Bar_Example.html
---------------------------
i was Just Visiting Sites So i thought to participate here in codeguru.
--------------------------
i hope Example with help ya.
Thanks
Y!Corrupt
im using a timer for every specific time interval the progress bar increases in value
Private Sub Timer1_Timer()
If Timer1.Enabled = True Then
ProgressBar1.Value = ProgressBar1.Value + 1
End If
If ProgressBar1.Value = 100 Then
Unload Me
End If
End Sub
~This code here tells the program to add "1" to the value of the progress bar for every "interval" property that the timer is set to... (interval = 1000 is equal to 1 second....) i set my timer to interval = "5" this is a fast interval im telling you...
okay so for every 5 units of interval, my progressbar increases it's value by one.. but what if the progressbar is full?? or in 100%? then i made an if statement telling that if the value of progressbar1 is 100 the timer will be disabled(.Enabled=false) and the form will be unloaded... or it is upto you what will happen next once the progress bar is full.. ^_^ i hope this helps... ^_^
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1 + 10
If ProgressBar1.Value = ProgressBar1.Max Then
ProgressBar1.Value = ProgressBar1.Min
Else
End If
If ProgressBar1 = Max Then
Unload Me
Form2.Show
End If
End Sub
create CommandButton,Timer,ProgressBar
code:
Private Sub Form_Load()
Timer1.Enabled = False
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
Private Sub Timer1_Timer()
ProgressBar1.Value = Val(ProgressBar1.Value) + Val(1)
If ProgressBar1.Value = Val(100) Then
Unload Me
Form2.Show
Else
End If
End Sub
dont change the names of the objects in properties:
set the interval of the timer1 to 10
code the timer1
Private Sub Timer1_Timer()
If ProgressBar1.Value = "100" Then
Unload Me
Else
ProgressBar1.Value = ProgressBar1.Value + Val(1)
End If
End Sub
Notice the code "Unload Me"... If the progressbar1 is equal to 100, the form will be close. that is the case if the loading is finished..
Its up to you what events will happen after the action that was made.. It can unload the form and reload to other form... Its up to you
Hope this will help you all guys...
Just try it and if you need some queries, fell free to mail me.. jordan_casaljay89@yahoo.com
Private Sub Command1_Click()
Me.Timer1.Enabled = True
End Sub
Private Sub Command2_GotFocus()
Me.Timer2.Enabled = True
End Sub
Private Sub Command3_GotFocus()
Me.Timer3.Enabled = True
End Sub
Private Sub Command4_GotFocus()
Timer4.Enabled = True
End Sub
Private Sub Form_Load()
Me.Frame1.Enabled = True
Me.Frame2.Enabled = False
Me.Frame3.Enabled = False
Me.Frame4.Enabled = False
End Sub
Private Sub Timer1_Timer()
Me.ProgressBar1.Value = Me.ProgressBar1.Value + 1
If Me.ProgressBar1.Value = 100 Then
Me.Timer1.Enabled = False
Me.ProgressBar1.Value = 0
Frame1.Enabled = False
Frame2.Enabled = True
End If
End Sub
Private Sub Timer2_Timer()
Me.ProgressBar1.Value = Me.ProgressBar1.Value + 1
If Me.ProgressBar1.Value = 100 Then
Me.Timer2.Enabled = False
Me.ProgressBar1.Value = 0
Frame2.Enabled = False
Frame3.Enabled = True
End If
End Sub
Private Sub Timer3_Timer()
Me.ProgressBar1.Value = Me.ProgressBar1.Value + 1
If Me.ProgressBar1.Value = 100 Then
Me.Timer3.Enabled = False
Me.ProgressBar1.Value = 0
Frame3.Enabled = False
Frame4.Enabled = True
End If
End Sub
Private Sub Timer4_Timer()
Me.ProgressBar1.Value = Me.ProgressBar1.Value + 1
If Me.ProgressBar1.Value = 100 Then
Me.Timer4.Enabled = False
Me.ProgressBar1.Value = 0
Frame4.Enabled = False
Frame1.Enabled = True
End If
End Sub
1. I can't find any ProgressBar properties called Increment. How do I do this?
2. Where this code should be put?
If ProgressBar1.Value = ProgressBar1.Maximum Then
ProgressBar1.Value = ProgressBar1.Minimum
MsgBox("The progress bar has reached its maximum value", MsgBoxStyle.Information, "Progress Bar")
Else
ProgressBar1.Increment(+10)
End If
I can't find any ProgressBar properties called Increment. How do I do this?
2. Where this code should be put?
If ProgressBar1.Value = ProgressBar1.Maximum Then
ProgressBar1.Value = ProgressBar1.Minimum
MsgBox("The progress bar has reached its maximum value", MsgBoxStyle.Information, "Progress Bar")
Else
ProgressBar1.Increment(+10)
End If
The Progress Bar:
The progress bar is very useful and looks professional in programs, here I will show you the main syntax’s for it, including an example code.
In this page, the progress bar’s maximum will be 100 and its minimum will be 0.
Syntax:
The “Value†syntax is at what point the progress bar is at, eg. If the progress bar was half full the value would be half the maximum the progress bar can reach.
The “Increment†syntax is how much it goes up by when the syntax is used, eg. Progressbar1.Increment (+10)
This would make the value of the progress bar 10, and it will move the green bar to 10.
The “Maximum†is how high the value of the progress bar can reach and the “Minimum†is how low it can reach.
E.g. If the minimum was 50 and the maximum was 150, the value and increment would start from 50 and go up to 150.
Example Code:
If ProgressBar1.Value = ProgressBar1.Maximum Then
ProgressBar1.Value = ProgressBar1.Minimum
MsgBox("The progress bar has reached its maximum value", MsgBoxStyle.Information, "Progress Bar")
Else
ProgressBar1.Increment(+10)
End If
Put this code in a button and place a progress bar and keep the name the same, when it reaches its maximum (Default Max = 100, Min = 0) it will go back to its minimum and display a message box.
So on a button type this:
Progressbar1.Increment(Progressbar1.Maximum / 10)
This will increment the progress bar 1/10th of its maximum.
Progressbar1.Increment(10)
This will just increment it by 10, but if your minimum is above 10 then it will not work.
Well here is a sample source code ,where "prgEgg" is a progress bar :
Option Explicit
Private msngStartTime As Single
Private Const intSeconds As Integer = 180
Private Sub cmdStart_Click()
prgEgg.Value = 0
msngStartTime = 0
tmrTest.Enabled = True
End Sub
Private Sub tmrTest_Timer()
Dim sngPercent As Single
If msngStartTime = 0! Then
msngStartTime = Timer
End If
sngPercent = 100 * (Timer - msngStartTime) / intSeconds
If sngPercent < 100 Then
prgEgg.Value = sngPercent
lblState.Caption = "Cooking..."
Else
prgEgg.Value = 100
lblState.Caption = "Done!"
Beep
tmrTest.Enabled = False
prgEgg.Value = 0!
End If
End Sub
help me guys
i am trying to create a database application but then am receiving an error message (method or data member not found). after that the '.Text' is selected to be corrected . the code is below
Private Sub cmdsave_Click()
Data1.Recordset.Fields("asset") = txt1.Text
Data1.Recordset.Fields("serial") = txt2.Text
Data1.Recordset.Fields("holder") = txt3.Text
Data1.Recordset.Fields("date") = txt4.Text
Data1.Recordset.Fields("model") = txt5.Text
Data1.Recordset.Fields("purchased") = txt6.Text
Data1.Recordset.Fields("price") = txt7.Text
Data1.Recordset.Update
Text2.Text = ""
Text1.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
cmdsave.Visible = False
cmdadd.Visible = True
End
End Sub
Make txt the
Make txt the same....
Ex.:
Text1.text = ""
VB6 progress bar
Please help I'm getting error while compile "Method or data member not found"
Dim i As Integer
Private Sub Timer1_Timer()
i = i + 1
ProgressBar1.Value = ProgressBar1.Value + 10
Select Case i
Case 1
Label5.Caption = "Loading Forms..."
Case 5
Label5.Caption = "Connecting Database..."
Case 12
Label5.Caption = "Preparing User Inteface..."
Case 17
Label5.Caption = "Checking Connectivity..."
Case 21
Label5.Caption = "Preparing Accounts Info..."
Case 23
Label5.Caption = "Preparations Complete!!!"
Timer1.Enabled = False
Unload Me
frmBlack.Show
frmRed.Show
End Select
End Sub
answer to the progressbar
Private Sub Timer1_Timer()
Dim i As Integer
If ProgressBar1.Value >= ProgressBar1.Max Then
frmSign.Show
Unload Me
End If
i = i + 1
ProgressBar1.Value = ProgressBar1.Value + 1
Select Case i
Case 1
Label5.Caption = "LOADING FORMS."
Case 19
Label5.Caption = "CONNECTING DATABASE.."
Case 29
Label5.Caption = "PREPARING USER INTERFACE..."
Case 49
Label5.Caption = "CHECKING CONNECTIVITY."
Case 69
Label5.Caption = "PREPARING ACCOUNTS INFO.."
Case 95
Label5.Caption = "WELCOME (G.P.D.)"
End Select
End Sub
WISH THIS ONE HELP YOU
CODE FOR PROGRESSBAR
Private Sub Form_Load()
ProgressBar1.Value = ProgressBar1.Value + 10
Label1.Caption = (ProgressBar1.Value / ProgressBar1.Max) * 100 & "%"
If ProgressBar1.Value = 98 Then
Unload Me
End If
End Sub
minimum value of a progress bar
k....im making a game....how to i make a minimum/maximum value with a progress bar?
vb
Can some one plz help me with a progress bar code on vb 2010 plz
Private Sub
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 1
If ProgressBar1.Value = 100 Then
Timer1.Enabled = False
End If
End Sub
Private Sub
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 1
If ProgressBar1.Value = 100 Then
Timer1.Enabled = False
End If
End Sub
Progress Bar With Text Box Value
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (progressBar1.Value <= progressBar1.Maximum)
{
progressBar1.Value += 1;
textBox1.Text = Convert.ToString(progressBar1.Value);
}
if (progressBar1.Value >= progressBar1.Maximum)
{
timer1.Enabled = false;
}
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
timer2.Enabled = false;
timer3.Enabled = false;
timer4.Enabled = false;
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Enabled = false;
timer2.Enabled = false;
timer3.Enabled = false;
timer4.Enabled = false;
}
private void button2_Click(object sender, EventArgs e)
{
timer2.Enabled = true;
timer1.Enabled = false;
timer3.Enabled = false;
timer4.Enabled = false;
}
private void timer2_Tick(object sender, EventArgs e)
{
if (progressBar1.Value > progressBar1.Minimum)
{
progressBar1.Value -= 1;
textBox1.Text = Convert.ToString(progressBar1.Value);
}
if (progressBar1.Value == progressBar1.Minimum)
{
timer2.Enabled = false;
}
}
private void button3_Click(object sender, EventArgs e)
{
timer3.Enabled = true;
timer1.Enabled = false;
timer2.Enabled = false;
timer4.Enabled = false;
}
private void timer3_Tick(object sender, EventArgs e)
{
if (progressBar1.Value <= progressBar1.Maximum)
{
progressBar1.Value += 1;
textBox1.Text = Convert.ToString(progressBar1.Value);
timer3.Enabled = false;
}
if (progressBar1.Value >= progressBar1.Maximum)
{
timer3.Enabled = false;
}
}
private void timer4_Tick(object sender, EventArgs e)
{
if (progressBar1.Value > progressBar1.Minimum )
{
progressBar1.Value -= 1;
textBox1.Text = Convert.ToString(progressBar1.Value);
timer4.Enabled = false;
}
if (progressBar1.Value == progressBar1.Minimum )
{
timer4.Enabled = false;
}
}
private void button4_Click(object sender, EventArgs e)
{
timer4.Enabled = true;
timer1.Enabled = false;
timer2.Enabled = false;
timer3.Enabled = false;
}
}
}
is this .net?
hey! this code ain't working in visual basic 6.0, there's semi colons in every line of a code, that's why i'm asking if this code is working only for vb.net???and if it's right, then, please give me some codes on how to use the progress bar in vb6.0,ok?thank...
Obviously its not VB6
Obviously its not VB6 because C# .NET doesn't work with VB6.
Please only post VB6 or equivalent to VB6 source code.
Progress Bar
Thanks for your immense contribution to my Knowledge
it actually worked and now my project is working.
Pictures database
Thank you very much for providing me with the progressive bar codes. It is working now perfectly. If I may ask once again. I have a database of some items. I wish as I scroll over the database, I be able to view its picture on the other side of the form. In other words, can I include images and view them individually withing a database record.
Thanks again for the good work you are doing for us.
Steve
thanks
thank you
code with image
i hope that you will also post or show the image of what is the overview of your created program so that user like me can imagine what it looks like.. thanks...
Progress Bar
Just Write this code with in the timer:
If Progressbar1.Value < Progressbar1.Max then Progressbar1.Value = Progressbar1.Value + 1
Code
This Is The Right Code By just Pressing A Button And it loads.
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 1
If ProgressBar1.Value = 100 Then
Timer1.Enabled = False
ProgressBar1.Value = 0
Unload Form1 (add this if you want a form to show when the progress bar is finished loading.)
Form2.Show
End If
End Sub
My
Name : Rifqi sulthan ikbari
Life in : Indonesia
Age : 14 th
Question : dan lain lain
how to book moves to the right and others
..PLease answer ..
Private Sub
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If ProgressBar1.Value = 100 Then
Timer1.Enabled = False
MsgBox "Done :)"
Exit Sub
Else
ProgressBar1.Value = ProgressBar1.Value + 1
End If
End Sub
proress bar code for Vb 2003
proress bar code for Vb 2003 plz
Prograss Bar
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If Timer1.Enabled = True Then
ProgressBar1.Value = ProgressBar1.Value + 1
End If
If ProgressBar1.Value = 100 Then
Unload Me
Form2.Show
End If
End Sub
---------------------------
Ok Here , in coding.
if We input our coding with out form2 it gives us error.
We Must Hide or Exit form1 to run it correctly ...
---------------------------
Here i m Uploading an example.
http://www.2shared.com/file/11150640/587a6c3c/Prograss_Bar_Example.html
---------------------------
i was Just Visiting Sites So i thought to participate here in codeguru.
--------------------------
i hope Example with help ya.
Thanks
Y!Corrupt
Thank you
Thank you
Thanks. Its
Thanks.
Its working..........
Visual Basic
Thank You so much for posting! Really it is useful for my assignments.
darn you are makign it all damn hard...
well this is how i do it...
im using a timer for every specific time interval the progress bar increases in value
Private Sub Timer1_Timer()
If Timer1.Enabled = True Then
ProgressBar1.Value = ProgressBar1.Value + 1
End If
If ProgressBar1.Value = 100 Then
Unload Me
End If
End Sub
~This code here tells the program to add "1" to the value of the progress bar for every "interval" property that the timer is set to... (interval = 1000 is equal to 1 second....) i set my timer to interval = "5" this is a fast interval im telling you...
okay so for every 5 units of interval, my progressbar increases it's value by one.. but what if the progressbar is full?? or in 100%? then i made an if statement telling that if the value of progressbar1 is 100 the timer will be disabled(.Enabled=false) and the form will be unloaded... or it is upto you what will happen next once the progress bar is full.. ^_^ i hope this helps... ^_^
question
your code and concept is totally wrong
The right progress bar code
this code is the right one
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1 + 10
If ProgressBar1.Value = ProgressBar1.Max Then
ProgressBar1.Value = ProgressBar1.Min
Else
End If
If ProgressBar1 = Max Then
Unload Me
Form2.Show
End If
End Sub
create
create CommandButton,Timer,ProgressBar
code:
Private Sub Form_Load()
Timer1.Enabled = False
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
Private Sub Timer1_Timer()
ProgressBar1.Value = Val(ProgressBar1.Value) + Val(1)
If ProgressBar1.Value = Val(100) Then
Unload Me
Form2.Show
Else
End If
End Sub
all of you guys are correct... this is the best explanation...
dont change the names of the objects in properties:
set the interval of the timer1 to 10
code the timer1
Private Sub Timer1_Timer()
If ProgressBar1.Value = "100" Then
Unload Me
Else
ProgressBar1.Value = ProgressBar1.Value + Val(1)
End If
End Sub
Notice the code "Unload Me"... If the progressbar1 is equal to 100, the form will be close. that is the case if the loading is finished..
Its up to you what events will happen after the action that was made.. It can unload the form and reload to other form... Its up to you
Hope this will help you all guys...
Just try it and if you need some queries, fell free to mail me.. jordan_casaljay89@yahoo.com
try mine
Private Sub Command1_Click()
Me.Timer1.Enabled = True
End Sub
Private Sub Command2_GotFocus()
Me.Timer2.Enabled = True
End Sub
Private Sub Command3_GotFocus()
Me.Timer3.Enabled = True
End Sub
Private Sub Command4_GotFocus()
Timer4.Enabled = True
End Sub
Private Sub Form_Load()
Me.Frame1.Enabled = True
Me.Frame2.Enabled = False
Me.Frame3.Enabled = False
Me.Frame4.Enabled = False
End Sub
Private Sub Timer1_Timer()
Me.ProgressBar1.Value = Me.ProgressBar1.Value + 1
If Me.ProgressBar1.Value = 100 Then
Me.Timer1.Enabled = False
Me.ProgressBar1.Value = 0
Frame1.Enabled = False
Frame2.Enabled = True
End If
End Sub
Private Sub Timer2_Timer()
Me.ProgressBar1.Value = Me.ProgressBar1.Value + 1
If Me.ProgressBar1.Value = 100 Then
Me.Timer2.Enabled = False
Me.ProgressBar1.Value = 0
Frame2.Enabled = False
Frame3.Enabled = True
End If
End Sub
Private Sub Timer3_Timer()
Me.ProgressBar1.Value = Me.ProgressBar1.Value + 1
If Me.ProgressBar1.Value = 100 Then
Me.Timer3.Enabled = False
Me.ProgressBar1.Value = 0
Frame3.Enabled = False
Frame4.Enabled = True
End If
End Sub
Private Sub Timer4_Timer()
Me.ProgressBar1.Value = Me.ProgressBar1.Value + 1
If Me.ProgressBar1.Value = 100 Then
Me.Timer4.Enabled = False
Me.ProgressBar1.Value = 0
Frame4.Enabled = False
Frame1.Enabled = True
End If
End Sub
Information Practices
it doesn't work
nope
DONT GET T
.Increment?
1. I can't find any ProgressBar properties called Increment. How do I do this?
2. Where this code should be put?
If ProgressBar1.Value = ProgressBar1.Maximum Then
ProgressBar1.Value = ProgressBar1.Minimum
MsgBox("The progress bar has reached its maximum value", MsgBoxStyle.Information, "Progress Bar")
Else
ProgressBar1.Increment(+10)
End If
(I am using VB6)
Tq.
progress bar
your logic is easy to understand
thanks.
BH@V!N
hi
you can use step instead of increment()
for example :
Private Sub Command1_Click()
For i = ProgressBar1.Min To ProgressBar1.Max Step 10
ProgressBar1.Value = i
Text1.Text = i
Text1.Refresh
Next i
End Sub
I can't find any ProgressBar
I can't find any ProgressBar properties called Increment. How do I do this?
2. Where this code should be put?
If ProgressBar1.Value = ProgressBar1.Maximum Then
ProgressBar1.Value = ProgressBar1.Minimum
MsgBox("The progress bar has reached its maximum value", MsgBoxStyle.Information, "Progress Bar")
Else
ProgressBar1.Increment(+10)
End If
(I am using VB6)
Progress Bar
The Progress Bar:
The progress bar is very useful and looks professional in programs, here I will show you the main syntax’s for it, including an example code.
In this page, the progress bar’s maximum will be 100 and its minimum will be 0.
Syntax:
Progressbar1.
.Value
.Increment(Number)
.Maximum
.Minimum
The “Value†syntax is at what point the progress bar is at, eg. If the progress bar was half full the value would be half the maximum the progress bar can reach.
The “Increment†syntax is how much it goes up by when the syntax is used, eg. Progressbar1.Increment (+10)
This would make the value of the progress bar 10, and it will move the green bar to 10.
The “Maximum†is how high the value of the progress bar can reach and the “Minimum†is how low it can reach.
E.g. If the minimum was 50 and the maximum was 150, the value and increment would start from 50 and go up to 150.
Example Code:
If ProgressBar1.Value = ProgressBar1.Maximum Then
ProgressBar1.Value = ProgressBar1.Minimum
MsgBox("The progress bar has reached its maximum value", MsgBoxStyle.Information, "Progress Bar")
Else
ProgressBar1.Increment(+10)
End If
Put this code in a button and place a progress bar and keep the name the same, when it reaches its maximum (Default Max = 100, Min = 0) it will go back to its minimum and display a message box.
So on a button type this:
Progressbar1.Increment(Progressbar1.Maximum / 10)
This will increment the progress bar 1/10th of its maximum.
Progressbar1.Increment(10)
This will just increment it by 10, but if your minimum is above 10 then it will not work.
Hope this helps.
Well here is a sample source
Well here is a sample source code ,where "prgEgg" is a progress bar :
Option Explicit Private msngStartTime As Single Private Const intSeconds As Integer = 180 Private Sub cmdStart_Click() prgEgg.Value = 0 msngStartTime = 0 tmrTest.Enabled = True End Sub Private Sub tmrTest_Timer() Dim sngPercent As Single If msngStartTime = 0! Then msngStartTime = Timer End If sngPercent = 100 * (Timer - msngStartTime) / intSeconds If sngPercent < 100 Then prgEgg.Value = sngPercent lblState.Caption = "Cooking..." Else prgEgg.Value = 100 lblState.Caption = "Done!" Beep tmrTest.Enabled = False prgEgg.Value = 0! End If End SubPost new comment