>* cmd.MouseDown() > >do while mdown() > * do repetitive thing for example > thisform.text1.Value = thisform.text1.Value + 1 > thisform.text1.Refresh() >enddo >>
Public oForm oForm = Newobject("repeatsample2") oForm.Show() Define Class repeatsample2 As Form Height = 67 Width = 242 DoCreate = .T. AutoCenter = .T. Caption = "Form1" AllowOutput = .F. Name = "Form1" Add Object Command1 As CommandButton With ; Top = 24, ; Left = 144, ; Height = 27, ; Width = 84, ; Caption = "Command1", ; Name = "Command1" Add Object Timer1 As Timer With ; Top = 24, ; Left = 0, ; Height = 23, ; Width = 23, ; Interval = 0, ; Name = "Timer1" Add Object Text1 As TextBox With ; Height = 23, ; Left = 24, ; Top = 24, ; Width = 108, ; Name = "Text1" Procedure Command1.MouseDown Lparameters nButton, nShift, nXCoord, nYCoord Thisform.Text1.Value = 1 Thisform.Text1.Refresh() *!* Single task here Thisform.Timer1.Interval = 1000 Thisform.Timer1.Reset() Thisform.Timer1.Enabled = .T. Endproc Procedure Command1.MouseUp Lparameters nButton, nShift, nXCoord, nYCoord Thisform.Timer1.Enabled = .F. Endproc Procedure Timer1.Timer Thisform.Text1.Value = Thisform.Text1.Value + 1 Thisform.Text1.Refresh() *!* Repetitive task here If This.Interval > 200 Then This.Interval = This.Interval - 200 Else If This.Interval > 10 Then This.Interval = This.Interval - 10 Endif Endif Endproc Enddefine