欢迎来到天天文库
浏览记录
ID:38361988
大小:264.50 KB
页数:4页
时间:2019-06-11
《使用VB编写星期查看器(截图说明+代码)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、用VB6.0编写星期查看器各项属性值一览表:项目属性值Form1Caption星期查询器-公元1年~9999年MaxButtonFalseLabel1CaptionLabel1Label2Caption年Label3Caption月Label4Caption日Label5Caption请在下面三个下拉组合框中选择所要查询公历日期:Label6Caption(空)VisibleFalseLabel7Caption是否继续查询?VisibleFalseCombo1TextCombo1ToolTipText选择
2、年份Combo2TextCombo2ToolTipText选择月份Combo3TextCombo3ToolTipText选择天数Command1Caption查询&SCommand2Caption退出&QCommand3Caption是&YVisibleFalseCommand4Caption否&NVisibleFalse各项控件大致分布截图:以下为程序代码:OptionExplicitDimWeek$,aa$,bb$,i%PrivateSubCommand1_Click()Form1.Caption="
3、很期待吧,结果已经出来了哦~"Label6.Visible=TrueLabel1.Visible=TrueDimxAsIntegerDimyAsIntegerDimzAsIntegerx=Val(Combo1.Text)Mod4y=Val(Combo1.Text)Mod100z=Val(Combo1.Text)Mod400Ifx=0ThenIfy<>0ThenLabel6.Caption="公元"+Combo1.Text+"年是闰年,"+Combo2.Text+"月"+Combo3.Text+"日是"En
4、dIfEndIfIfz=0ThenLabel6.Caption="公元"+Combo1.Text+"年是闰年,"+Combo2.Text+"月"+Combo3.Text+"日是"EndIfIfx<>0ThenLabel6.Caption="公元"+Combo1.Text+"年是平年,"+Combo2.Text+"月"+Combo3.Text+"日是"EndIfIfy=0ThenIfz<>0ThenLabel6.Caption="公元"+Combo1.Text+"年是平年,"+Combo2.Text+"月"
5、+Combo3.Text+"日是"EndIfEndIfCombo1.Enabled=FalseCombo2.Enabled=FalseCombo3.Enabled=FalseCommand1.Visible=FalseCommand2.Visible=FalseCommand3.Visible=TrueCommand4.Visible=TrueLabel7.Visible=TrueEndSubPrivateSubCommand2_Click()IfMsgBox("还没开始就要退出吗?",vbQuestio
6、n+vbYesNo+vbDefaultButton2,"星期查询器友情提示")=vbYesThenMsgBox"好吧,您非要这样的话,再见吧!",vbInformation+vbOKOnly,"星期查询器"EndElseEndIfEndSubPrivateSubCommand3_Click()Command1.Visible=TrueCommand2.Visible=TrueCommand3.Visible=FalseCommand4.Visible=FalseCombo1.Enabled=TrueCom
7、bo2.Enabled=TrueCombo3.Enabled=TrueLabel1.Visible=FalseLabel6.Visible=FalseLabel7.Visible=FalseForm1.Caption="星期查询器-公元1年~9999年"EndSubPrivateSubCommand4_Click()MsgBox"谢谢您的使用!再见",vbInformation+vbOKOnly,"星期查看器"EndEndSubPrivateSubForm_Load()MsgBox"欢迎使用星期查询器!"
8、,vbInformation+vbOKOnly,"星期查询器"Fori=1To9999Combo1.AddItemCStr(i)NextiFori=1To12Combo2.AddItemCStr(i)NextiCombo1.Text=Year(Now):Combo2.Text=Month(Now)CallChkMonthDayCombo3.Text=Day(Now)CallShowWeekEndSubPrivateSubCom
此文档下载收益归作者所有