Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Carloid De Guzman
  Where is Carloid De Guzman?
 CaloocanCity
 Philippines
 Carloid De Guzman
 Tags
Subject: RE: About MS Progressbar control version 5.0
Thread ID: 365429 Message ID: 365432 # Views: 73 # Ratings: 4
Version: Visual FoxPro 9 SP2 Category: Active X Controls & OLE Automation
Date: Wednesday, December 26, 2012 12:12:00 PM         
   


> How to use MS Progressbar control version 5.0?
>
> Can you help me about this?
>
> Thanks and Godbless!

If possible use version 6.0. Other then that it is straight forward. Say you placed one on your form and sized as you see fit. Rest is about updating it. Do not try to calculate percentage for updating. Progress bar does that for you. Instead simply set its Max to your target count (ie: reccount() in a table scan). Then to update it simply set its value to current value. Here is a simple sample:

Declare Sleep In win32API Integer dwMilliSecs
oForm = Createobject('myProgBar')
oForm.Caption = 'Connecting to server...'
oForm.Show
Sleep(1000) && Delay to simulate connection

lnMax = 40
oForm.ShowBar(m.lnMax)
For ix=1 To m.lnMax
  oForm.UpdateBar(m.ix)
  oForm.Caption = 'Processing table ' + ;
    Transform(m.ix) + ' of ' + Transform(m.lnMax)
  Sleep(300) && Delay to simulate table processing
Endfor
oForm.Release

Define Class myProgBar As Form
  Height = 30
  Width = 300
  HalfHeightCaption=.T.
  ControlBox = .F.
  AutoCenter=.T.

  Add Object pbar As OleControl With ;
    top=5,Height=20,Width=300,Visible=.F.,;
    OleClass='MSComCtlLib.ProgCtrl'

  Procedure ShowBar(tnMax)
    With This.pbar
      .Value = 0
      .Max = m.tnMax
      .Visible = .T.
    Endwith
  Endproc

  Procedure UpdateBar(tnValue)
    With This.pbar
      .Value = Min(m.tnValue,.Max)
    Endwith
  Endproc
Enddefine




Cetin Basoz

.Net has got better.Think about moving - check my blog:
My Blog
Blog (mirror) - sounds to be down


Support Wikipedia

ENTIRE THREAD

About MS Progressbar control version 5.0 Posted by Carloid Costa @ 12/26/2012 10:43:15 AM
RE: About MS Progressbar control version 5.0 Posted by Cetin Basoz @ 12/26/2012 12:12:00 PM