Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Salam!

I am using visual studio 2008 and using the progress bar component.

I am using the progress bar to show that while query is running. But the problem is that while the form of progress bar is shown it is static during the execution.
First before calling to my query function I am calling frmmain.show (form containing the progress bar)

Then I called my query and in query loop am using the update function (frmmain.update) to keep the progress bar updated. the probelm is that while showing the bar it remains static.

Can any one help. Is there any way of doing it in vs 2008?
Posted
Updated 8-Jun-10 2:18am
v2

First declare your maximum, minimum and startvalue.
Let's assume your loop does a maximum of 100 iterations.

ProgressBar1.Maximum = 100
ProgressBar1.Minimum = 0
ProgressBar1.Value = 0



Then implement in your loop:

ProgressBar1.Value = ... [current loopvalue]
 
Share this answer
 
If you want your program to remain responsive you'll have to use threading and delegates / events.

Do some research there are a lot of articles about threading.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900