欢迎来到天天文库
浏览记录
ID:57691154
大小:12.50 KB
页数:1页
时间:2020-09-01
《vb编写时钟代码.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、时钟:Constpi=3.14159Dimlen1,len2,len3AsSinglePrivateSubForm_Load()len1=Sqr((Abs((Line1.Y2-Line1.Y1)))^2+(Abs(Line1.X2-Line1.X1))^2)len2=Sqr((Abs((Line2.Y2-Line2.Y1)))^2+(Abs(Line2.X2-Line2.X1))^2)len3=Sqr((Abs((Line3.Y2-Line3.Y1)))^2+(Abs(Line3.X2-Line3.X1))^2)EndSubPrivateSubtimer1_timer()s=Second(Ti
2、me)m=Minute(Time)h=Hour(Time)+m/60Line1.X2=Line1.X1+len1*Sin(pi*s/30)Line1.Y2=Line1.Y1-len1*Cos(pi*s/30)Line2.X2=Line2.X1+len2*Sin(pi*m/30)Line2.Y2=Line2.Y1-len2*Cos(pi*m/30)Ifh>=12Thenh=h-12Line3.X2=Line3.X1+len3*Sin(pi*h/6)Line3.Y2=Line3.Y1-len3*Cos(pi*h/6)Label13.Caption=NowEndSub
此文档下载收益归作者所有