473,768 Members | 1,937 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Collecti ons.ObjectModel .ReadOnlyCollec tion(Of String) =
My.Computer.Fil eSystem.GetFile s(tbSource.Text , IIf(optSubdirec tories,
FileIO.SearchOp tion.SearchAllS ubDirectories,
FileIO.SearchOp tion.SearchTopL evelOnly))

pbFiles.Minimum = 1
pbFiles.Maximum = foundFiles.Coun t

For Each foundFile As String In foundFiles
If fpath <> System.IO.Path. GetDirectoryNam e(foundFile) Then
fpath = System.IO.Path. GetDirectoryNam e(foundFile)
tsStatus.Text = "Processing Folder: " & fpath
PrintLine(intFi leNumber, "Processing Folder: " & fpath)
End If
<< code snipped >>
I += 1
If I Mod 20 = 0 Then Application.DoE vents()
pbFiles.Perform Step()
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 1361
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.Collecti ons.ObjectModel .ReadOnlyCollec tion(Of String) =
My.Computer.Fil eSystem.GetFile s(tbSource.Text , IIf(optSubdirec tories,
FileIO.SearchOp tion.SearchAllS ubDirectories,
FileIO.SearchOp tion.SearchTopL evelOnly))

pbFiles.Minimum = 1
pbFiles.Maximum = foundFiles.Coun t

For Each foundFile As String In foundFiles
If fpath <> System.IO.Path. GetDirectoryNam e(foundFile) Then
fpath = System.IO.Path. GetDirectoryNam e(foundFile)
tsStatus.Text = "Processing Folder: " & fpath
PrintLine(intFi leNumber, "Processing Folder: " & fpath)
End If
<< code snipped >>
I += 1
If I Mod 20 = 0 Then Application.DoE vents()
pbFiles.Perform Step()
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.Perform Step()
I used
pbFiles.Value=I


"R. MacDonald" <sc****@NO-SP-AMcips.ca> wrote in message
news:43******** *************** @news.wanadoo.n l...
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.Collecti ons.ObjectModel .ReadOnlyCollec tion(Of String) =
My.Computer.Fil eSystem.GetFile s(tbSource.Text , IIf(optSubdirec tories,
FileIO.SearchOp tion.SearchAllS ubDirectories,
FileIO.SearchOp tion.SearchTopL evelOnly))

pbFiles.Minimum = 1
pbFiles.Maximum = foundFiles.Coun t

For Each foundFile As String In foundFiles
If fpath <> System.IO.Path. GetDirectoryNam e(foundFile) Then
fpath = System.IO.Path. GetDirectoryNam e(foundFile)
tsStatus.Text = "Processing Folder: " & fpath
PrintLine(intFi leNumber, "Processing Folder: " & fpath)
End If
<< code snipped >>
I += 1
If I Mod 20 = 0 Then Application.DoE vents()
pbFiles.Perform Step()
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.Perform Step()
I used
pbFiles.Value=I


"R. MacDonald" <sc****@NO-SP-AMcips.ca> wrote in message
news:43******** *************** @news.wanadoo.n l...
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.Collecti ons.ObjectModel .ReadOnlyCollec tion(Of String) =
My.Computer.Fil eSystem.GetFile s(tbSource.Text , IIf(optSubdirec tories,
FileIO.SearchOp tion.SearchAllS ubDirectories,
FileIO.SearchOp tion.SearchTopL evelOnly))

pbFiles.Minimum = 1
pbFiles.Maximum = foundFiles.Coun t

For Each foundFile As String In foundFiles
If fpath <> System.IO.Path. GetDirectoryNam e(foundFile) Then
fpath = System.IO.Path. GetDirectoryNam e(foundFile)
tsStatus.Text = "Processing Folder: " & fpath
PrintLine(intFi leNumber, "Processing Folder: " & fpath)
End If
<< code snipped >>
I += 1
If I Mod 20 = 0 Then Application.DoE vents()
pbFiles.Perform Step()
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
332
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
6310
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 steps can take seconds to process, but others could take upto 10 minutes (leaving the users thinking nothing is happening!). Is there a way to show the progressbar smoothly increasing until the final step has finished instead of clunking it's way...
8
19633
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. pBar1.Minimum = 1; // Set Maximum to the total number of files to copy. pBar1.Maximum = 4; //filenames.Length;
1
5425
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 (form called ProgressForm) and the built the dll. Then I reference this new assembly from within my asp.net applicaiton and tried to access Windows.Forms.ProgressBar from within the ProgressForm but apparently it doesn't work. Because it won't...
2
4507
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 this) the main application shouldn't be accessible when the login password hasn't been entered correctly. anybody who can give me some help with this?
3
4795
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 something? I'm shocked that .NET doesn't have a style property for the progressbar control! -- - Mitchell Vincent - kBilling - An easy and affordable billing solution
1
696
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 of the total is already loaded. But I do this in a dirty way: I increment the progressbar with the same number after each table, but not all tables contain the same amount of data. I solved this with starting an other thread to increment the...
5
2476
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 sender, EventArgs e) { DatabaseOperations.ClearDatabase(); }
4
4368
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 ProgressBar. When I click on the menu in my MDI Parent, a child form is loaded. I would like to know if there is a way to increment a progressbar value while child form is loading ? I tried to use background worker but i had some cross thread access...
0
10018
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9964
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8840
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7387
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6656
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5285
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3933
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 we have to send another system
3
2808
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.