rick
某一列也希望字体更大一些,我看现在好像某列的字体大小只有标题头可以设置,list.font=不支持接收字体数组
import win.ui;
import godking.vlistEx;
/*DSG{{*/
mainForm = win.form(text="vlistEx - table adapter";right=849;bottom=578)
mainForm.add(
vlist={cls="vlistEx";left=10;top=10;right=840;bottom=568;db=1;dl=1;dr=1;dt=1;edge=1;transparent=1;z=1}
)
/*}}*/
var t = { fields={"序号","姓名","年龄","地址","政治面貌"} };
for(i=1;100;1){
var tt={};
tt["序号"]="[@rowindex]"; // 行序号标记是不允许编辑修改的
tt["姓名"]=math.random(1000,9999)+"姓名";
tt["年龄"]=math.random(10,99);
tt["地址"]=math.random(1000,9999)+"地址";
tt["政治面貌"]="党员";
..table.push(t,tt);
}
mainForm.vlist.setTable(t,{"<img name='@ownerDrawImg',w=14,h=14> 序号","姓名","年龄","地址","政治面貌"},150,0x1);
mainForm.vlist.setColColor(2,0xFF0000/*文本颜色*/,/*背景颜色*/)
mainForm.vlist.setColColor(4,0x00FF00/*文本颜色*/,/*背景颜色*/)
mainForm.vlist.onDrawCellRectContent = function(row,col,hdc,rect,bkcolor,text,font,colalign){
if col===2 {
font.name = "楷体";
font.point = 15;
}elseif col===4{
font.name = "黑体";
font.point = 18;
}
}
mainForm.show();
win.loopMessage();