以下是引用wedsic在2017-8-26 17:40:55的发言:
怎么使用这个类
简单示例:
图片附件: 游客没有浏览图片的权限,请
登录 或
注册
** test.prg
CREATE CURSOR tt (picname C(100))
FOR i=0 TO 100
INSERT INTO tt VALUES ("test"+TRANSFORM(i%3+1)+".bmp")
ENDFOR
GO TOP
of = CREATEOBJECT("myForm")
of.show
READ EVENTS
RETURN
DEFINE CLASS myForm as Form
ADD OBJECT grid1 as myGrid
PROCEDURE unload
CLEAR EVENTS
ENDPROC
ENDDEFINE
DEFINE CLASS myGrid as grid
RecordSource="tt"
PROCEDURE Init
this.Column1.RemoveObject("Text1")
this.Column1.AddObject("Image1", "myGridImage")
this.Column1.Sparse = .F.
ENDPROC
ENDDEFINE
DEFINE CLASS myGridImage AS Image
Visible = .T.
PROCEDURE BackStyle_ACCESS
this.Picture = tt.picname
RETURN this.BackStyle
ENDPROC
ENDDEFINE