以下事件后期版本已做调整,仅供参考。
关于绘制过程中可触发的事件,参考如下(以实际版本中的智能提示为准):
Code AardioLine:46复制
1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.- onDrawCellBg(row,col,hdc,rect,bkcolor,text) = @.onDrawCellBg =
function
(row,col,hdc,rect,bkcolor,text){ -
- __
-
return
true
; - }
- afterDrawCellBg(row,col,hdc,rect,bkcolor,text) = @.afterDrawCellBg =
function
(row,col,hdc,rect,bkcolor,text){ -
- __
- }
- onDrawCellRect(row,col,hdc,rect,bkcolor,text,font,colalign) = @.onDrawCellRect =
function
(row,col,hdc,rect,bkcolor,text,font,colalign){ -
- __
-
return
true
; - }
- onDrawCellRectBg(row,col,hdc,rect,bkcolor,text) = @.onDrawCellRectBg =
function
(row,col,hdc,rect,bkcolor,text){ -
- __
-
return
true
; - }
- afterDrawCellRectBg(row,col,hdc,rect,bkcolor,text) = @.afterDrawCellRectBg =
function
(row,col,hdc,rect,bkcolor,text){ -
- __
- }
- afterDrawCell(row,col,hdc,rect,bkcolor,text,font,colalign) = @.afterDrawCell =
function
(row,col,hdc,rect,bkcolor,text,font,colalign){ -
- __
- }
- afterDrawCellBorder(row,col,hdc,rect,bkcolor,text,font,colalign) = @.afterDrawCellBorder =
function
(row,col,hdc,rect,bkcolor,text,font,colalign){ -
- __
- }
- onStartPaint(hdc,rect) = @.onStartPaint =
function
(hdc,rect){ -
- __
- }
实例效果:

示例代码:
Code AardioLine:29复制
1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.import
win
.ui;import
godking.vlistEx;- mainForm =
win
.form(text="vlistEx - table adapter"
;right=849
;bottom=578
) - mainForm.add(
- vlist={cls=
"vlistEx"
;left=10
;top=10
;right=840
;bottom=570
;db=1
;dl=1
;dr=1
;dt=1
;edge=1
;transparent=1
;z=1
} - )
- mainForm.show();
var
t = { fields={"序号"
,"姓名"
,"年龄"
,"地址"
,"身份证"
} };for
(i=1
;10000
;1
){-
var
tt={}; - tt[
"序号"
]="[@rowindex]"
; - tt[
"姓名"
]="["
+string
.random(math
.random(1
,10
))+"]"
; - tt[
"年龄"
]="["
+string
.random(math
.random(1
,20
))+"]"
; - tt[
"地址"
]="["
+string
.random(math
.random(1
,30
))+"]"
; - tt[
"身份证"
]="["
+string
.random(math
.random(1
,40
))+"]"
; - ..
table
.push(t,tt); - }
- mainForm.vlist.afterDrawCellBorder =
function
(row,col,hdc,rect,bkcolor,text){ -
if
row===6
{ - rect.top = rect.bottom-
6
; - ..gdi.fillRect(hdc,0xFF0000,rect);
- }
- }
- mainForm.vlist.setTable(t);
- mainForm.vlist.setColWidthFit();
win
.loopMessage();