vfp如何实现进度条
我想实现销售订单进度显示,比如:有几十条订单,我想通过一个表显示没一个订单的工序,如果第一工序完成,就用蓝色显示。如何实现?我用了grid控件,不能控制单元格的颜色。着急,请大师指点
[此贴子已经被作者于2021-6-13 08:47编辑过]
** test.prg CREATE CURSOR tt (工序 I, 进度 C(10)) FOR i=1 TO 100 INSERT INTO tt VALUES (i%4,"") ENDFOR GO TOP of = CREATEOBJECT("form1") of.show(1) RETURN DEFINE CLASS form1 as Form ADD OBJECT grid1 as _grid ENDDEFINE DEFINE CLASS _grid as Grid visible = .T. columncount = 2 PROCEDURE init this.column1.width = 50 this.column1.ControlSource = "tt.工序" this.column1.header1.caption = "工序" this.column1.DynamicBackColor = "ICASE(tt.工序==1,0xFF9090,tt.工序==2,0x90FF90,tt.工序==3,0x9090FF,0xFFFFFF)" this.column2.width = 100 this.column2.ControlSource = "" this.column2.sparse = .F. this.column2.removeobject("Text1") this.column2.addobject("cb1", "ColorBar") this.column2.header1.caption = "进度" ENDPROC ENDDEFINE DEFINE CLASS ColorBar as Container visible = .T. backstyle = 0 borderwidth = 0 ADD OBJECT label1 as label WITH alignment=2,forecolor=0 PROCEDURE BackStyle_ACCESS this.label1.width = tt.工序*30 this.label1.backcolor = ICASE(tt.工序==1,0xFF9090,tt.工序==2,0x90FF90,tt.工序==3,0x9090FF,0xFFFFFF) this.label1.caption = TRANSFORM(INT(100*tt.工序/3))+"%" RETURN this.BackStyle ENDPROC ENDDEFINE