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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PROGRESS BAR PROBLEM 3

Status
Not open for further replies.

teknik

Programmer
Feb 27, 2001
33
IN
How to show the progress in a Progress Bar when the calculations such as scanning a table etc are going in the background?
 
Obviously you're going to have to put a 'Do Events' or the like somewhere in your procedure to allow a timer to trigger the progress bar update when needed. And this, of course, will slow things up slightly. There are probably ways to minimize the effect, but I'll let the real experts around here decide what's best. -- Dave
 
Hi teknik,

You can begin here: faq184-216

There is also an example of a progress bar in the FFCs. Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
teknik

If you want to include your progress bar in a form, the following are the NON DEFAULT properties for the only two additional controls needed.

DOEVENTS is not required.

You will need to determine the position and size of txtProgressBar and make both controls .Visible = .T. during processing, and .Visible = .F. on EXITing the loop.

WITH THISFORM.txtProgressBar
[tab].Alignment = 2
[tab].DisabledBackColor = RGB(255,25,255)
[tab].DisabledForeColor = RGB(0,0,0)
[tab].Enabled = .F.
[tab].TabStop = .F.
[tab].Visible = .F.
ENDWITH

WITH THISFORM.shpProgressBar
[tab].BackStyle = 0
[tab].BorderStyle = 0
[tab].DrawMode = 14
[tab].FillColor = RGB(0,0,128)
[tab].FillStyle = 0
[tab].Height = && 2 less than txtProgressBar
[tab].Top = && 2 lower than txtProgressBar
[tab].Visible = .F.
[tab].Width = 1
ENDWITH

The following code might be typical of table processing and needs including in your SCAN...ENDS loop etc.

WITH THISFORM
[tab].txtProgressBar.Value = ;
[tab]ALLTRIM(STR((lnCount / RECCOUNT(
)*100))) + [%]
[tab].shpProgressBar.Width = ;
[tab]lnCount * THISFORM.txtProgressBar.Width / RECCOUNT(
)
ENDWITH

Chris :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top