![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2005
Posts: 22
Rep Power: 0
![]() |
Question on progress bar
I have a question.....what code you use in order to make the status show on a status bar? does the status bar code have to be integrated with the other functions that are going on at that time in order to update as the other processes are carried out?
|
|
|
|
|
|
#2 |
|
Newbie
Join Date: Oct 2005
Location: Richardson - Good ol' Telecom Capital of the World
Posts: 3
Rep Power: 0
![]() |
Progress bar or status bar? .... nope:
create a timer control which will handle the semaphor event. Make your status bar and assign the code to update the status bar based on the interval. |
|
|
|
|
|
#3 |
|
Expert Programmer
|
Well there's a progress bar in VB6 that you'll find under windows common controls (not to be confused with the status bar). Basically you define it a Min and a Max, and the progress bar then reflects the position of Value within this range (i.e. if Min=0 Max=3 and Value=1 then 25% of the bar would be filled). To answer your question, yes you need to update the value property of the progress bar throughout your time consuming property, and as you're most probably in a loop, call DoEvents as well. Hope this helps.
|
|
|
|
|
|
#4 |
|
Newbie
Join Date: Jan 2005
Posts: 22
Rep Power: 0
![]() |
eh....ill stick to the basics.....i just thought itd be nice to let the user know how much of the information is processed as it goes along...thank you rory
![]() |
|
|
|
|
|
#5 |
|
Expert Programmer
|
Sorry I didn't make it clear enough first time! Basically a progress bar is gui element simply representing a percentage / fraction. It's up to you to write the code to update it regularly within the time-consuming process being conducted.
![]() |
|
|
|
|
|
#6 |
|
Professional Programmer
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4
![]() |
You can use a timer control as cplusruss said. Then let suppose that you need to do some 35 operations, for example.
The formula for the prog bar percentage would be: (100 * operDone) / 35 Where 'operDone' is the variable than holds the number of done operations. A better way would be to place this formula after end of every operation which would consume less cpu speed. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|