Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / June 2004

Tip: Looking for answers? Try searching our database.

Progress bar doesn't increment

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff - 14 Jun 2004 21:12 GMT
I created a windows form that has a progress bar on it. I am running  a bunch of statements to update data on the database.  I want the progress bar to increment (perform one step) after each update.  The problem is that the progress bar doesn't move (it just sits there until the end) can anyone give me an example of how to accomplish this?

example:
progressBar1.Visible=true;
progressBar1.Show();
progressBar1.Maximum = 24;
progressBar1.Step = 1;
progressBar1.PerformStep();
Perform_update1;
progressBar1.PerformStep();
Perform_update2;
progressBar1.PerformStep();
Perform_update3;
etc.

thanks in advance

-Jeff-
Mythran - 15 Jun 2004 00:39 GMT
> I created a windows form that has a progress bar on it. I am running  a bunch of statements to update data on the database.  I want the progress bar to
increment (perform one step) after each update.  The problem is that the progress
bar doesn't move (it just sits there until the end) can anyone give me an example
of how to accomplish this?

> example:
> progressBar1.Visible=true;
> progressBar1.Show();
> progressBar1.Maximum = 24;
> progressBar1.Step = 1;
> progressBar1.PerformStep();
----------- Application.DoEvents();
> Perform_update1;
> progressBar1.PerformStep();
----------- Application.DoEvents();
> Perform_update2;
> progressBar1.PerformStep();
----------- Application.DoEvents();
> Perform_update3;
> etc.
>
> thanks in advance
>
> -Jeff-

Hope that helps.

Mythran
William Ryan  eMVP - 15 Jun 2004 03:37 GMT
You may want to trap RowUpdating/RowUpdated for each Adapter you are calling
update on.  Right before you call update, set the Maximum value of the
progress bar to that datatables.Rows.Count, then increment it on either
Updating or Updated.  After the update, reset it to 0 (the value) then reset
the Maximum to the next table's Rows.Count.

Signature

W.G. Ryan MVP Windows - Embedded

http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/

> I created a windows form that has a progress bar on it. I am running  a bunch of statements to update data on the database.  I want the progress bar
to increment (perform one step) after each update.  The problem is that the
progress bar doesn't move (it just sits there until the end) can anyone give
me an example of how to accomplish this?

> example:
> progressBar1.Visible=true;
[quoted text clipped - 12 lines]
>
> -Jeff-
Chris Botha - 15 Jun 2004 04:20 GMT
Actually your whole app will seam frozen as you are performing step after
step sequentially. To up the progress bar (and also for the window to
process any other messages like move, close, etc), call
Application.DoEvents();  call after each increment.

> I created a windows form that has a progress bar on it. I am running  a bunch of statements to update data on the database.  I want the progress bar
to increment (perform one step) after each update.  The problem is that the
progress bar doesn't move (it just sits there until the end) can anyone give
me an example of how to accomplish this?

> example:
> progressBar1.Visible=true;
[quoted text clipped - 12 lines]
>
> -Jeff-

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.