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.
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 .Alignment = 2 .DisabledBackColor = RGB(255,25,255) .DisabledForeColor = RGB(0,0,0) .Enabled = .F. .TabStop = .F. .Visible = .F. ENDWITH
WITH THISFORM.shpProgressBar .BackStyle = 0 .BorderStyle = 0 .DrawMode = 14 .FillColor = RGB(0,0,128) .FillStyle = 0 .Height = && Same as txtProgressBar .Top = && Same as txtProgressBar .Visible = .F. .Width = 1 ENDWITH
The following code might be typical of table processing and needs including in your SCAN...ENDS loop etc, where lnCount is the number of records processed. WITH THISFORM .txtProgressBar.Value = ; ALLTRIM(STR((lnCount / RECCOUNT([TABLE])*100))) + [%] .shpProgressBar.Width = ; lnCount * .txtProgressBar.Width / RECCOUNT([TABLE]) ENDWITH