欢迎来到天天文库
浏览记录
ID:41117563
大小:59.50 KB
页数:3页
时间:2019-08-16
《VB 源码 日历编程1》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、效果图DimmDateAsDatePrivateSubCommand1_Click(IndexAsInteger)IfIndex=0ThenmDate=DateAdd("M",-1,mDate)IfIndex=1ThenmDate=DateAdd("M",1,mDate)LoadDayCaptionEndSubPrivateSubForm_Load()mDate=NowLabel2(0).Left=Label1(0).LeftLabel2(0).Top=Label1(0).Top+Label1(0).Height+100LoadWeekLabelLoadDayLabelLoadDayCap
2、tionEndSubPrivateFunctionLoadWeekLabel()DimiAsIntegerFori=1To6LoadLabel1(i)Label1(i).Visible=TrueLabel1(i).Left=Label1(i-1).Left+Label1(i-1).Width+10NextLabel1(0).Caption="星期日"Label1(1).Caption="星期一"Label1(2).Caption="星期二"Label1(3).Caption="星期三"Label1(4).Caption="星期四"Label1(5).Caption="星期五"Label1(
3、6).Caption="星期六"EndFunctionPrivateFunctionLoadDayLabel()DimiAsIntegerFori=1To41LoadLabel2(i)Label2(i).Visible=TrueLabel2(i).Left=Label1(iMod7).LeftIfi>6ThenLabel2(i).Top=Label2(i-7).Top+Label2(i-7).Height+10EndIfNextEndFunctionPrivateFunctionLoadDayCaption()Label3.Caption=Format(mDate,"YYYY-MM")Di
4、miAsInteger,IndexAsIntegerDimfistWeekDayAsInteger,daysAsInteger,tempDateAsDatefistWeekDay=Weekday(DateAdd("d",1-Day(mDate),mDate))-2tempDate=DateAdd("d",1-Day(mDate),mDate)tempDate=DateAdd("M",1,tempDate)tempDate=DateAdd("d",-1,tempDate)days=Day(tempDate)Fori=0To41Label2(i).Caption=i-fistWeekDayLa
5、bel2(i).Visible=(i-fistWeekDay)>0And(i-fistWeekDay)<=daysNextEndFunction
此文档下载收益归作者所有