回复 3楼 一彭ok
** test.prg
CREATE CURSOR tt (f1 I, f2 I, f3 I)
FOR i=1 TO 10
INSERT INTO tt VALUES (RAND()*100, i, i*2)
ENDFOR
INDEX on f1 TAG f1_tag
GO TOP
of = CREATEOBJECT("form1")
of.show(1)
DEFINE CLASS form1 as Form
ADD OBJECT cmd1 as commandbutton WITH top=10,left=10,height=22,caption="下一条"
ADD OBJECT cmd2 as commandbutton WITH top=10,left=130,height=22,caption="上一条"
ADD OBJECT grid1 as grid WITH top=40
PROCEDURE Activate
this.grid1.setfocus
ENDPROC
PROCEDURE cmd1.click
SKIP IN "tt"
IF EOF("tt")
GO BOTTOM IN "tt"
ENDIF
thisform.grid1.setfocus
ENDPROC
PROCEDURE cmd2.click
SKIP -1 IN "tt"
IF BOF("tt")
GO TOP IN "tt"
ENDIF
thisform.grid1.setfocus
ENDPROC
ENDDEFINE
[此贴子已经被作者于2018-5-22 20:58编辑过]