程序代码:
Public oForm
oForm=NEWOBJECT("form1")
oForm.Show
DEFINE CLASS form1 AS form
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
ADD OBJECT label1 AS label WITH ;
AutoSize = .T., ;
Caption = "Label1", ;
Height = 16, ;
Left = 72, ;
Top = 48, ;
Width = 38, ;
Name = "Label1"
ADD OBJECT label2 AS label WITH ;
AutoSize = .T., ;
Caption = "Label2", ;
Height = 16, ;
Left = 72, ;
Top = 96, ;
Width = 38, ;
Name = "Label2"
ADD OBJECT label3 AS label WITH ;
AutoSize = .T., ;
Caption = "Label3", ;
Height = 16, ;
Left = 72, ;
Top = 144, ;
Width = 38, ;
Name = "Label3"
PROCEDURE MouseDown
LPARAMETERS nButton, nShift, nXCoord, nYCoord
thisform.lnjs = thisform.lnjs + 1
DO CASE
CASE MOD(thisform.lnjs, 3) = 1
thisform.label1.Caption = TRANSFORM(nXCoord) + "," + TRANSFORM(nYCoord)
CASE MOD(thisform.lnjs, 3) = 2
thisform.label2.Caption = TRANSFORM(nXCoord) + "," + TRANSFORM(nYCoord)
CASE MOD(thisform.lnjs, 3) = 0
thisform.label3.Caption = TRANSFORM(nXCoord) + "," + TRANSFORM(nYCoord)
ENDCASE
ENDPROC
PROCEDURE Init
thisform.AddProperty("lnjs", 0)
ENDPROC
ENDDEFINE