Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 6th, 2005, 7:15 PM   #1
l337killa07
Newbie
 
Join Date: Jan 2005
Posts: 22
Rep Power: 0 l337killa07 is on a distinguished road
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?
l337killa07 is offline   Reply With Quote
Old Oct 13th, 2005, 10:41 AM   #2
cplusruss
Newbie
 
cplusruss's Avatar
 
Join Date: Oct 2005
Location: Richardson - Good ol' Telecom Capital of the World
Posts: 3
Rep Power: 0 cplusruss is on a distinguished road
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.
cplusruss is offline   Reply With Quote
Old Oct 13th, 2005, 11:01 AM   #3
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
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.
Rory is offline   Reply With Quote
Old Oct 17th, 2005, 8:09 PM   #4
l337killa07
Newbie
 
Join Date: Jan 2005
Posts: 22
Rep Power: 0 l337killa07 is on a distinguished road
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
l337killa07 is offline   Reply With Quote
Old Oct 18th, 2005, 2:30 PM   #5
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
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.
Rory is offline   Reply With Quote
Old Oct 18th, 2005, 2:53 PM   #6
ivan
Professional Programmer
 
ivan's Avatar
 
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4 ivan is on a distinguished road
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.
ivan is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:16 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC