做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="<<" float="true" pos="18,14,57,36" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" /> 6 <Button name="BTN_UP_YEAR" text="<<" float="true" pos="276,15,313,40" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" /> 7 <Button name="BTN_DOWN_YEAR" text=">>" 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='cells.png' source='0,0,81,81'" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='cells.png' source='0,0,81,81'" hotimage="file='cells.png' source='0,81,81,162'" /> 26 <Button name="ButtonUI41" text="星期一" float="true" pos="62,1,123,26" bkimage="file='cells.png' source='0,0,81,81'" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='cells.png' source='0,0,81,81'" hotimage="file='cells.png' source='0,81,81,162'" /> 27 <Button name="ButtonUI42" text="星期二" float="true" pos="123,1,184,26" bkimage="file='cells.png' source='0,0,81,81'" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='cells.png' source='0,0,81,81'" hotimage="file='cells.png' source='0,81,81,162'" /> 28 <Button name="ButtonUI43" text="星期五" float="true" pos="306,1,367,26" bkimage="file='cells.png' source='0,0,81,81'" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='cells.png' source='0,0,81,81'" hotimage="file='cells.png' source='0,81,81,162'" /> 29 <Button name="ButtonUI44" text="星期四" float="true" pos="245,1,306,26" bkimage="file='cells.png' source='0,0,81,81'" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='cells.png' source='0,0,81,81'" hotimage="file='cells.png' source='0,81,81,162'" /> 30 <Button name="ButtonUI45" text="星期三" float="true" pos="184,1,245,26" bkimage="file='cells.png' source='0,0,81,81'" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='cells.png' source='0,0,81,81'" hotimage="file='cells.png' source='0,81,81,162'" /> 31 <Button name="ButtonUI46" text="星期六" float="true" pos="367,1,428,26" bkimage="file='cells.png' source='0,0,81,81'" textcolor="#FF000000" disabledtextcolor="#FFA7A6AA" align="center" normalimage="file='cells.png' source='0,0,81,81'" hotimage="file='cells.png' source='0,81,81,162'" /> 32 </Container> 33 <Container name="ContainerUI3" pos="0,75,429,295"