Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ProgressBar in VB.Net

Status
Not open for further replies.

mariomoreira

IS-IT--Management
Mar 31, 2005
4
BE
Hi, i'm developing a tool that works with a database with more then 200 tables, and when the tool takes to long to find the informations that the user need, so i want to put a progress bar in tha form while te program search and load the data from the database!

Do any body know how to do that!?
 
Just add a ProgressBar to your form and increment it's value whenever needed (that's the bit you'll have trouble with as how will the database know that it is say 50% of the way there to getting your results?).

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
If it's one big query, no, there's nothing you can do to accurately show progress.

If there are several small queries, you can increment a variable after each, to show progress.

Note that in the first case, you can display a fake progress bar using a timer. Sites such as Expedia do this with an animated gif -- it's fake, but it looks like something is going on.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
We actually went with a 'process' bar instead of a progress bar. Kinda like the old Netscape thing, or as my co-workers call it, the "Knight Rider" bar. Using a StatusBarChild class I found online ( by E. Marcon) I created a 'ProcessIndicator' class that uses a Double Buffer graphics class to draw 2 gradiants. In the Process Indicator class there is an indipendant thread that moves the center position of the two gradiants.
Process.bmp


-Rick

----------------------

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
Hi.. i have a progress bar in one of my aplication forms, but it only apears when the form finishes is loading!!!! how can i make a kind of delay(lets say 2 seconds, just to se the prgress bar runing normaly???

thanks!
 
It will only appear when the form finishes loading as it is part of the form (you can't expect something to be shown before it's parent has been created).

Why don't you try a form with just a progress bar on it and display that as a kind of 'splash screen' or only initiate the search once the form has been loaded (i.e. on a button click - the bar could be updated by running it in it's own thread)?

You could then implement either the progress bar or the process bar from Rick's post.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top