oMyform = CREATE('myform') oMyform.Show READ EVENTS return Define Class MYFORM AS Form height = 60 caption = "Testing Progress bar" autocenter = .t. maxbutton = .f. minbutton = .f. alwaysontop = .t. procedure destroy clear events endproc Add OBJECT oProgress AS opbar with ; Left = Thisform.Width/2,; Top = 5,; Left = 5 Add OBJECT CMDRUN AS CommandButton with ; Caption = "Run",; Top = 30,; Height = 20 Procedure CMDRUN.Click set cursor off for i = 1 to 100 thisform.oProgress.value = i thisform.caption = "Testing Progress bar "+allt(str(i))+"%" =inkey(0.2) endfor set cursor on clear events Endproc Procedure CMDRUN.init this.left = (thisform.width-this.width) / 2 endproc Enddefine DEFINE Class opbar AS Olecontrol OleClass = "MScomctlLIB.ProgCtrl.2" OleLCID = 1033 PROCEDURE Init this.Width = this.parent.width-10 &&Adjusts the Width of the Label to 1 character this.left = (thisform.width-this.width) / 2 This.Max = 100 This.Min = 0 Endproc Enddefine