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

ActiveX Control

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How I can initialize Progress Bar at run time. First time it initialize with form form and if I run 2nd time it does not work and if I close and reopen form then again it works well.
Regds:
Ahsan Rana
 
Create a custom method (ex. Initialise) and ajust your progressBar from there.
 
Sorry! Can't Understand. Please re-explain.

Best Regds:
Ahsan Rana
 
If it's the standard MS Progress bar, then in whatever method you start your process, try adding something like:
Thisform.olecontrol1.control.Init()

Rick
 
Sorry! does not work well. It gives a message " member CONTROL does not evaluate to an object"
 
OK, then try Thisform.olecontrol1.Init() [without .control], sometimes you'll need this qualification for OLE controls, and sometimes you don't. It's usually only necessary when the control and VFP have the same named PEM.

Rick
 
I believe the actual line Rick was thinking of is:
Code:
Thisform.olecontrol1.OBJECT.Init()
Use OBJECT, not CONTROL. :eek:)

Ian

 
Ian,
You are correct! It's amazing how something so wrong, looked so right when I typed it. I hope Ahsan will forgive my "senior" moment.

Rick
 
Don't feel bad, Rick. I seem to remember you correcting one of MINE just last week...

Ian
 
I write the following line of code by it gives message
"UN-KNOWN NAME"

Thisform.ProgBar.Object.Init()

Ahsan Rana
 
Hi,

Are you not using the _therm.vcx from VFP.
In that case you can hide it at start. When you want it to work make it visible.

pbar1 is a object on the form from _therm.vcx(progress bar.)

select mytable
lnreccount = RECCOUNT()
lnpbarcount = 1
thisform.pbar1.visible = .T.
do while !eof()
****
your calculation go here
****

skip
THISFORM.pbar.UPDATE((lnpbarcount/lnreccount)*100)
lnpbarcount = lnpbarcount + 1
enddo
thisform.pbar1.visible = .F.

This works fine with me.

Hope this was what you were looking for.

AjoyK
 
Hi,

Are you not using the _therm.vcx from VFP.
In that case you can hide it at start. When you want it to work make it visible.

pbar1 is a object on the form from _therm.vcx(progress bar.)

select mytable
lnreccount = RECCOUNT()
lnpbarcount = 1
thisform.pbar1.visible = .T.
do while !eof()
****
your calculation go here
****

skip
THISFORM.pbar1.UPDATE((lnpbarcount/lnreccount)*100)
lnpbarcount = lnpbarcount + 1
enddo
thisform.pbar1.visible = .F.

This works fine with me.

Hope this was what you were looking for.

AjoyK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top