citect2018页面日期时间显示美化

前段时间现场使用citect2018做了一个小的项目,不过使用单位总觉得日期时间显示不好看,本着为其服务的精神,我尝试着做了一下美化,不知道能入法眼不。

1.新建两个内部变量strWeekly,strMonth,都是字符串型。新建一个cicode函数

FUNCTION showweekly()
IF DateWeekDay(TimeCurrent())=1 THEN
strWeekly="星期天"
END
IF DateWeekDay(TimeCurrent())=2 THEN
strWeekly="星期一"
END
IF DateWeekDay(TimeCurrent())=3 THEN
strWeekly="星期二"
END
IF DateWeekDay(TimeCurrent())=4 THEN
strWeekly="星期三"
END
IF DateWeekDay(TimeCurrent())=5 THEN
strWeekly="星期四"
END
IF DateWeekDay(TimeCurrent())=6 THEN
strWeekly="星期五"
END
IF DateWeekDay(TimeCurrent())=7 THEN
strWeekly="星期六"
END

IF DateMonth(TimeCurrent())=1 THEN
strMonth="一月"
END
IF DateMonth(TimeCurrent())=2 THEN
strMonth="二月"
END
IF DateMonth(TimeCurrent())=3 THEN
strMonth="三月"
END
IF DateMonth(TimeCurrent())=4 THEN
strMonth="四月"
END
IF DateMonth(TimeCurrent())=5 THEN
strMonth="五月"
END
IF DateMonth(TimeCurrent())=6 THEN
strMonth="六月"
END
IF DateMonth(TimeCurrent())=7 THEN
strMonth="七月"
END
IF DateMonth(TimeCurrent())=8 THEN
strMonth="八月"
END
IF DateMonth(TimeCurrent())=9 THEN
strMonth="九月"
END
IF DateMonth(TimeCurrent())=10 THEN
strMonth="十月"
END
IF DateMonth(TimeCurrent())=11 THEN
strMonth="十一月"
END
IF DateMonth(TimeCurrent())=12 THEN
strMonth="十二月"
END
END

画面进入事件调用这个函数。

2. 画一个矩形,146*133,填充颜色RGB为255,128,0,画几条短的竖线,宽度为6,3D效果为突出,深度为1

放四个数字控件,分别显示strWeekly、DateDay(Timecurrent())、DateYear(Timecurrent(),10)、strMonth

 

 3. 

画一个矩形,146*133,填充颜色RGB为255,43,43,画几条短的竖线,宽度为6,3D效果为突出,深度为1

放一个数字控件,显示timetostr(timecurrent(),0)

保存编译运行,就可以看到效果了

 、

posted @ 2021-03-16 15:53  来自金沙江的小鱼  阅读(372)  评论(1编辑  收藏  举报