用Duilib界面库开发的一个日历控件

估考虑使用Duilib这一免费开源的利器,在业务功能实现上,办公自动化少不了日历控件的使用,在网上寻了半天,没有好的开源的日历控件,更多的是web版的日历控件,估决定参考web版的日历控件,使用duilib实现一个winform版的日历,在网上找到的比较炫的一个日历如下:

做web开发的朋友可以在这里找到此控件:

http://www.open-open.com/ajax/ajax20091109225817.htm  

下面我们使用Duilib实现winform版的日历控件:

a、将其web版的资源文件,主要是图片,下载到本地;

b、编写duilib需要使用到的xml文件,Calendar.xml;

     View Code    

 1 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>  2 <Window size="429,470" sizebox="4,4,6,6" caption="0,0,0,30">  3 <VerticalLayout name="VerticalLayoutUI1" pos="205,186,265,216" width="60" height="30" bkimage="body.png" bordercolor="#009DABCE">  4 <Container name="ContainerUI1" pos="0,0,429,50" width="429" height="50">  5 <Button name="BTN_UP_MONTH" text="&lt;&lt;" float="true" pos="18,14,57,36" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" />  6 <Button name="BTN_UP_YEAR" text="&lt;&lt;" float="true" pos="276,15,313,40" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" />  7 <Button name="BTN_DOWN_YEAR" text="&gt;&gt;" float="true" pos="324,15,361,40" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" />  8 <Combo name="CMB_MONTH" float="true" pos="75,15,175,37" droptype="droplist" width="100" height="22" textpadding="4,1,1,1" normalimage="file='combo.png' source='0,0,100,22' corner='2,2,20,2'" hotimage="file='combo.png' source='0,22,100,44' corner='2,2,22,2'" pushedimage="file='combo.png' source='0,44,100,66' corner='2,2,22,2'">  9 <ListLabelElement text="1月" selected="true" height="23"/> 10 <ListLabelElement text="2月" height="23" /> 11 <ListLabelElement text="3月" height="23" /> 12 <ListLabelElement text="4月" height="23" /> 13 <ListLabelElement text="5月" height="23" /> 14 <ListLabelElement text="6月" height="23" /> 15 <ListLabelElement text="7月" height="23" /> 16 <ListLabelElement text="8月" height="23" /> 17 <ListLabelElement text="9月" height="23" /> 18 <ListLabelElement text="10月" height="23" /> 19 <ListLabelElement text="11月" height="23" /> 20 <ListLabelElement text="12月" height="23" /> 21 </Combo> 22 <Edit name="TXT_YEAR" text="2013" float="true" pos="202,14,262,36" bkcolor="#FFFFFFFF" textpadding="4,3,4,3" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" /> 23 </Container> 24 <Container name="ContainerUI2" pos="0,44,429,69" width="429" height="25"> 25 <Button name="ButtonUI40" text="星期日" float="true" pos="1,1,62,26" bkimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" hotimage="file=&apos;cells.png&apos; source=&apos;0,81,81,162&apos;" /> 26 <Button name="ButtonUI41" text="星期一" float="true" pos="62,1,123,26" bkimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" hotimage="file=&apos;cells.png&apos; source=&apos;0,81,81,162&apos;" /> 27 <Button name="ButtonUI42" text="星期二" float="true" pos="123,1,184,26" bkimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" hotimage="file=&apos;cells.png&apos; source=&apos;0,81,81,162&apos;" /> 28 <Button name="ButtonUI43" text="星期五" float="true" pos="306,1,367,26" bkimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" hotimage="file=&apos;cells.png&apos; source=&apos;0,81,81,162&apos;" /> 29 <Button name="ButtonUI44" text="星期四" float="true" pos="245,1,306,26" bkimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" hotimage="file=&apos;cells.png&apos; source=&apos;0,81,81,162&apos;" /> 30 <Button name="ButtonUI45" text="星期三" float="true" pos="184,1,245,26" bkimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" hotimage="file=&apos;cells.png&apos; source=&apos;0,81,81,162&apos;" /> 31 <Button name="ButtonUI46" text="星期六" float="true" pos="367,1,428,26" bkimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file=&apos;cells.png&apos; source=&apos;0,0,81,81&apos;" hotimage="file=&apos;cells.png&apos; source=&apos;0,81,81,162&apos;" /> 32 </Container> 33 <Container name="ContainerUI3" pos="0,75,429,295" 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值