搬家第23天-citectv7.4microsoftflexgrid控件单元格文字控制
如果我们希望在microsoft flexgrid控件中对单元格文件做出控制,可以在cicode代码中这样写:
FUNCTION FlexGridText(INT row,INT col,STRING txt)
OBJECT hFexGrid
hFexGrid=ObjectByName("AN9");
_ObjectSetProperty(hFexGrid,"row",row);
_ObjectSetProperty(hFexGrid,"col",col);
_ObjectSetProperty(hFexGrid,"Text",txt);
_ObjectSetProperty(hFexGrid,"CellAlignment",1);//对齐方式:0单元内容顶部左对齐,1单元内容中间左对齐。对字符串的缺省设置值,2单元内容底部左对齐,3单元内容顶部居中,4
_ObjectSetProperty(hFexGrid,"CellBackcolor",MakeCitectColour(0,0,255));
_ObjectSetProperty(hFexGrid,"CellFontBold",1);
_ObjectSetProperty(hFexGrid,"CellFontItalic",1);
_ObjectSetProperty(hFexGrid,"CellFontName","宋体");
_ObjectSetProperty(hFexGrid,"CellFontSize",14);
//_ObjectSetProperty(hFexGrid,"CellHeight",200); //只读属性,无法修改
//_ObjectSetProperty(hFexGrid,"CellWidth",600); //只读属性,无法修改
END
页面的按钮中加入以下代码
FlexGridText(3,2,"hello");
然后就可以把第三行第二列的文字设置成宋体,字号14,加粗,斜体,背景红色。