473,473 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

making progressbar work

28 New Member
Do any expert know how to use progressbar with a application

suppose i am copying files from one location to other, then at that time i would like to know the % completed ,total time expected,remaining time, and
progress bar should progress according to that

I hope somebody can give me idea abt this

thanks
regards
Prashanth
Apr 25 '06 #1
1 2064
Banfa
9,065 Recognized Expert Moderator Expert
You haven't said what programming environment you are using.

However progress bars are quite simple objects, the display a value in relation to it's minimum and maximum possible values. This is often used as a percentage by setting the minimum to 0 and the maximum to 100.

A progress bar only changes what it is displaying when it's display value is changed by the program so the program needs to be peforming an operation that is not atomic. That is an operation that does not only return once it is finished.

An examples of an atomic operation is copying a single file, the program calls CopyFile(Visual C++) and the function returns when it has completed the task, an example of a non-atomic operation is copying multiple files, the program calls CopyFile multiple times and has control returned to it at the end of each copy.

NOTE copying a single file can be made no-atomic by calling CopyFileEx rather than CopyFile.


What you want clearly falls into the second example I have given, to do this you need to
  1. Initialise your Progress Bar before the copy begins with it's minimum and maximum values. NOTE in C++ the default values for minimum and maximum are rather non-intuitively minimum=100, maximum=0
  2. Start your copy progress
  3. In between each file copy update the progress bar with the current progress

In a file copy situation the current progress can be represented either as the number files copied out of the number of files to copy or the amount of data copied out of the total amount of data to copy. The first of these is usually easier to calculate but does not give a very good represntation of the actual time it 1 of the files to copy is significantly larger than the others.
Apr 25 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: jez123456 | last post by:
Hi, thanks for the previous advice on progressbars with showing the percentage. I would now like to create a less clunky version. I.e at the moment my progressbar shows 7 separate steps. Some...
8
by: needin4mation | last post by:
Please consider: foreach (ListViewItem item in listViewFiles.Items) { // Display the ProgressBar control. pBar1.Visible = true; // Set Minimum to 1 to represent the first file being copied....
1
by: Mehr H | last post by:
I've been trying to figure out how i can embed a Windows.Forms.ProgressBar in my webform (aspx) file. I have tried putting a Windows.Forms.ProgressBar as public on a regular winform designer form...
2
by: rh | last post by:
Hi, I would like use a ProgressBar control in a Winows Form to show the progress while a loop is running within a method. It works fine when the loop is short. But when the loop has many items...
3
by: Mitchell Vincent | last post by:
In other programming languages I've been able to easily change the style of a progress bar between smooth and blocked. I find that is either really hidden or impossible in .NET. Am I missing...
1
by: nobody | last post by:
Hi I'm currently developing a Windows application. At the start of the application I load several tables into datatables in a dataset. I also use a progressbar to show the user how much percent...
0
by: Rick | last post by:
I use VB .Net and try to do som intensive actions on a database (in a seperate module). I defined an Interface for updating a progressbar on the main form. When I test it from a procedure within...
2
by: =?Utf-8?B?QWFyb24=?= | last post by:
Since some controls such as the DataGridView take a long time to update themselves when performing certain tasks, I have added a StatusStrip with a ProgressBar on it. While I am updating the...
9
by: appelsinagurk | last post by:
Hi I'm fairly new to .Net programming so I'll try to explain my problem as easy as I can, and in advanced sorry for my poor english. I've got some spare hours where I work, so I've decided to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.