473,396 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Progress bar step

Sometimes I have to loop thru' 55 times, sometimes 240 times.

How do I set the Maximum and, Step property of progress bar so that it
reflects the progress inside the while loop?

i = 55;

for (int x= 0; x < i; x++)
{
.....
ProgressBar1.PerformStep().
}
Oct 18 '06 #1
3 9363
//doing property names from top of my head so use common sense and set to
what i obviously mean
// also i am assuming your step is set at 1

ProgressBar1.Max = 55;

i = 55;

for (int x= 0; x < i; x++)
{
if(ProgressBar1.Value < ProgressBar1.Max)
ProgressBar1.PerformStep().
}

That would step by 1 every iteration and on the value equaling the max the
bar would stop.

Why are you doing it this way anyway? This just for testing it?

Remember fire your progress bar on a new thread to measure whatever it is
that is loading and so on so that it doesn't block your processing thread of
data that it is measuring.

Hope that helps, difficult to know how much use it is when the code above
would only be useful for testing and experimenting with how a progress bar
works.
"Alan T" <al*************@yahoo.com.auwrote in message
news:Ow****************@TK2MSFTNGP03.phx.gbl...
Sometimes I have to loop thru' 55 times, sometimes 240 times.

How do I set the Maximum and, Step property of progress bar so that it
reflects the progress inside the while loop?

i = 55;

for (int x= 0; x < i; x++)
{
.....
ProgressBar1.PerformStep().
}

Oct 18 '06 #2
What I am doing is to process files in a directory as input parameter so the
number of files will be different depends on the directory.
I need to reflect the progress to the user of how many files have been
processed.

"Daniel" <Da*****@vestryonline.comwrote in message
news:Ox**************@TK2MSFTNGP04.phx.gbl...
//doing property names from top of my head so use common sense and set to
what i obviously mean
// also i am assuming your step is set at 1

ProgressBar1.Max = 55;

i = 55;

for (int x= 0; x < i; x++)
{
if(ProgressBar1.Value < ProgressBar1.Max)
ProgressBar1.PerformStep().
}

That would step by 1 every iteration and on the value equaling the max the
bar would stop.

Why are you doing it this way anyway? This just for testing it?

Remember fire your progress bar on a new thread to measure whatever it is
that is loading and so on so that it doesn't block your processing thread
of data that it is measuring.

Hope that helps, difficult to know how much use it is when the code above
would only be useful for testing and experimenting with how a progress bar
works.
"Alan T" <al*************@yahoo.com.auwrote in message
news:Ow****************@TK2MSFTNGP03.phx.gbl...
>Sometimes I have to loop thru' 55 times, sometimes 240 times.

How do I set the Maximum and, Step property of progress bar so that it
reflects the progress inside the while loop?

i = 55;

for (int x= 0; x < i; x++)
{
.....
ProgressBar1.PerformStep().
}


Oct 18 '06 #3
I see

In that case you set the progressbar.max to how many files you are
expecting.
Set the stepvalue to 1

and then as you process each do the if statement i gave you before. Once you
process them all your prgressbar will be at 100%. Process file, update
progressbar etc until done

"Alan T" <al*************@yahoo.com.auwrote in message
news:uY**************@TK2MSFTNGP03.phx.gbl...
What I am doing is to process files in a directory as input parameter so
the number of files will be different depends on the directory.
I need to reflect the progress to the user of how many files have been
processed.

"Daniel" <Da*****@vestryonline.comwrote in message
news:Ox**************@TK2MSFTNGP04.phx.gbl...
>//doing property names from top of my head so use common sense and set to
what i obviously mean
// also i am assuming your step is set at 1

ProgressBar1.Max = 55;

i = 55;

for (int x= 0; x < i; x++)
{
if(ProgressBar1.Value < ProgressBar1.Max)
ProgressBar1.PerformStep().
}

That would step by 1 every iteration and on the value equaling the max
the bar would stop.

Why are you doing it this way anyway? This just for testing it?

Remember fire your progress bar on a new thread to measure whatever it is
that is loading and so on so that it doesn't block your processing thread
of data that it is measuring.

Hope that helps, difficult to know how much use it is when the code above
would only be useful for testing and experimenting with how a progress
bar works.
"Alan T" <al*************@yahoo.com.auwrote in message
news:Ow****************@TK2MSFTNGP03.phx.gbl...
>>Sometimes I have to loop thru' 55 times, sometimes 240 times.

How do I set the Maximum and, Step property of progress bar so that it
reflects the progress inside the while loop?

i = 55;

for (int x= 0; x < i; x++)
{
.....
ProgressBar1.PerformStep().
}



Oct 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Paul | last post by:
i have been working with vb6 for a while but never had the pleasure of using progress bars. That is until now, one of the programs i have written has just been modified so that large csv files of...
8
by: Randy | last post by:
Hi, is it possible to show the progress of a big file being copied e.g. in a "progressbar"? I tried to use file.copy - but this seems to make no sense :-( Thanks in advance, Randy
3
by: Rich Wallace | last post by:
Hi all, I'm writing a simple SQL Server DTS management VB.NET web app for our first level support group. I'm adding in the capability to execute a package but I was curious if there was a way to...
4
by: bfulford | last post by:
I have a macro that needs to have a progress meter displayed since it is long running. I moved the Macro's instructions to a table and pulled those records into a recordset that is looped through....
14
by: moley_cruz | last post by:
Hi, If i start a process using System.Diagnostics.Process.Start(myprog.exe, myattributes) is it possible to display a running process bar instead of showing a DOS window which shows what the...
9
by: Scirious | last post by:
People, I want to do same things with a progress bar but I don't know how. So, how do I change it to make it a solid bar, not a step byt step as the default? And how do I make it a vertical bar?...
4
by: sam | last post by:
Hi - I have an ASP page - that will be making about 7 calls to a database. What I want is to show progress to the users so that they can tell each database call is in progress. The asp...
9
by: esakal | last post by:
Hello, I'm programming an application based on CAB infrastructure in the client side (c# .net 2005) Since my application must be sequencally, i wrote all the code in the UI thread. my...
2
by: Michael | last post by:
Hi. I need some script that will show progress bar in classic asp. I did not found match example. I found samples with bar only when we need many repeated steps. My function has diferrent time of...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.