控件字体颜色及背景色设置【分享】
金蝶云社区-云社区用户4u731234
云社区用户4u731234
10人赞赏了该文章 9297次浏览 未经作者许可,禁止转载编辑于2017年03月22日 19:11:26

表头控件字体颜色及背景色设置:
原始需求:
请问文本框如何通过插件设置文本框的颜色啊?
https://vip.kingdee.com/article/22515

先上运行效果:

注册Python脚本:
表单构建插件Python脚本

附上Python脚本:
[code]#表单构建插件
#设定控件字体颜色及背景色
#PythonControlSetColor
#by wanghl 2017-03-22

clr.AddReference('System')
clr.AddReference('Kingdee.BOS.Core')
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
from Kingdee.BOS.Core.Metadata.EntityElement import *
from System import *

def CreateControl(e):
if e.ControlAppearance.Key == "F_PAIK_Text":#控件标识
#设定控件背景颜色
e.Control["backcolor"] = '#FFFF00';
#设定控件字体颜色
e.Control["forecolor"] = '#FF0000';[/code]
完 谢谢。