473,385 Members | 1,655 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,385 software developers and data experts.

ProgressBar Question

I have the following, extracted from my code (sorry, the files 'line' of
code wraps across the first five lines of the copy) and pbFiles is
(obviously?) the progressbar.

Dim foundFiles As
System.Collections.ObjectModel.ReadOnlyCollection( Of String) =
My.Computer.FileSystem.GetFiles(tbSource.Text, IIf(optSubdirectories,
FileIO.SearchOption.SearchAllSubDirectories,
FileIO.SearchOption.SearchTopLevelOnly))

pbFiles.Minimum = 1
pbFiles.Maximum = foundFiles.Count

For Each foundFile As String In foundFiles
If fpath <> System.IO.Path.GetDirectoryName(foundFile) Then
fpath = System.IO.Path.GetDirectoryName(foundFile)
tsStatus.Text = "Processing Folder: " & fpath
PrintLine(intFileNumber, "Processing Folder: " & fpath)
End If
<< code snipped >>
I += 1
If I Mod 20 = 0 Then Application.DoEvents()
pbFiles.PerformStep()
Next

I'm confused - the progressbar is 'finished' long before I'm done
processing in fact it's filled when I'm about 15% of the way done. It was
my impression that since I've given it the min and max - and then call
performstep as I process each file, *IT* should be able to caluclate how
far along the progressbar is ... what is it that I'm understanding
incorrectly??

Thanks //al
Feb 11 '06 #1
3 1343
Hello, Al,

The default property of the Step property is 10. Try setting it to 1.

Cheers,
Randy
al jones wrote:
I have the following, extracted from my code (sorry, the files 'line' of
code wraps across the first five lines of the copy) and pbFiles is
(obviously?) the progressbar.

Dim foundFiles As
System.Collections.ObjectModel.ReadOnlyCollection( Of String) =
My.Computer.FileSystem.GetFiles(tbSource.Text, IIf(optSubdirectories,
FileIO.SearchOption.SearchAllSubDirectories,
FileIO.SearchOption.SearchTopLevelOnly))

pbFiles.Minimum = 1
pbFiles.Maximum = foundFiles.Count

For Each foundFile As String In foundFiles
If fpath <> System.IO.Path.GetDirectoryName(foundFile) Then
fpath = System.IO.Path.GetDirectoryName(foundFile)
tsStatus.Text = "Processing Folder: " & fpath
PrintLine(intFileNumber, "Processing Folder: " & fpath)
End If
<< code snipped >>
I += 1
If I Mod 20 = 0 Then Application.DoEvents()
pbFiles.PerformStep()
Next

I'm confused - the progressbar is 'finished' long before I'm done
processing in fact it's filled when I'm about 15% of the way done. It was
my impression that since I've given it the min and max - and then call
performstep as I process each file, *IT* should be able to caluclate how
far along the progressbar is ... what is it that I'm understanding
incorrectly??

Thanks //al

Feb 11 '06 #2
I only used the progress bar once I believe rather then
pbFiles.PerformStep()
I used
pbFiles.Value=I


"R. MacDonald" <sc****@NO-SP-AMcips.ca> wrote in message
news:43***********************@news.wanadoo.nl...
Hello, Al,

The default property of the Step property is 10. Try setting it to 1.

Cheers,
Randy
al jones wrote:
I have the following, extracted from my code (sorry, the files 'line' of
code wraps across the first five lines of the copy) and pbFiles is
(obviously?) the progressbar.

Dim foundFiles As
System.Collections.ObjectModel.ReadOnlyCollection( Of String) =
My.Computer.FileSystem.GetFiles(tbSource.Text, IIf(optSubdirectories,
FileIO.SearchOption.SearchAllSubDirectories,
FileIO.SearchOption.SearchTopLevelOnly))

pbFiles.Minimum = 1
pbFiles.Maximum = foundFiles.Count

For Each foundFile As String In foundFiles
If fpath <> System.IO.Path.GetDirectoryName(foundFile) Then
fpath = System.IO.Path.GetDirectoryName(foundFile)
tsStatus.Text = "Processing Folder: " & fpath
PrintLine(intFileNumber, "Processing Folder: " & fpath)
End If
<< code snipped >>
I += 1
If I Mod 20 = 0 Then Application.DoEvents()
pbFiles.PerformStep()
Next

I'm confused - the progressbar is 'finished' long before I'm done
processing in fact it's filled when I'm about 15% of the way done. It
was
my impression that since I've given it the min and max - and then call
performstep as I process each file, *IT* should be able to caluclate how
far along the progressbar is ... what is it that I'm understanding
incorrectly??

Thanks //al

Feb 12 '06 #3
Thank you both, yes, the way I did it was to assigne the value as
pbFiles.value += 1
which works the way I expected - just didn't see it before, thanks //al

On Sun, 12 Feb 2006 14:04:27 -0500, academic wrote:
I only used the progress bar once I believe rather then
pbFiles.PerformStep()
I used
pbFiles.Value=I


"R. MacDonald" <sc****@NO-SP-AMcips.ca> wrote in message
news:43***********************@news.wanadoo.nl...
Hello, Al,

The default property of the Step property is 10. Try setting it to 1.

Cheers,
Randy
al jones wrote:
I have the following, extracted from my code (sorry, the files 'line' of
code wraps across the first five lines of the copy) and pbFiles is
(obviously?) the progressbar.

Dim foundFiles As
System.Collections.ObjectModel.ReadOnlyCollection( Of String) =
My.Computer.FileSystem.GetFiles(tbSource.Text, IIf(optSubdirectories,
FileIO.SearchOption.SearchAllSubDirectories,
FileIO.SearchOption.SearchTopLevelOnly))

pbFiles.Minimum = 1
pbFiles.Maximum = foundFiles.Count

For Each foundFile As String In foundFiles
If fpath <> System.IO.Path.GetDirectoryName(foundFile) Then
fpath = System.IO.Path.GetDirectoryName(foundFile)
tsStatus.Text = "Processing Folder: " & fpath
PrintLine(intFileNumber, "Processing Folder: " & fpath)
End If
<< code snipped >>
I += 1
If I Mod 20 = 0 Then Application.DoEvents()
pbFiles.PerformStep()
Next

I'm confused - the progressbar is 'finished' long before I'm done
processing in fact it's filled when I'm about 15% of the way done. It
was
my impression that since I've given it the min and max - and then call
performstep as I process each file, *IT* should be able to caluclate how
far along the progressbar is ... what is it that I'm understanding
incorrectly??

Thanks //al

Feb 13 '06 #4

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

Similar topics

1
by: Maka Sili | last post by:
Using ProgressBar.Enabled = false does not dim the progress bar. There must be a way. I hope somebody could guide me. Thanks.
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: sotto | last post by:
I need a loginscreen, that will show a progressbar that changes values based on a method in the main application (loading data from database) how would i do this? (i guess i need threading for...
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...
5
by: mamin | last post by:
I have, the following question: I have a WindowsForm with ProgressBar progressBar1 and Button button1. After onClick event on button the following method executes: button_Click(object...
4
by: Thomas | last post by:
Hello, I don't know if such question was already posted but I didn't find anything through different posts. I have the Main MDI window with a StatusBar. Inside my StatusBar there is a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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,...

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.