钟表的指针,用vb怎么编写

怎么修改此程序段可以该为钟表指针PrivateSubForm_Load()Form1.ScaleLeft=-2000Form1.ScaleTop=1500Form1.Sc... 怎么修改此程序段可以该为钟表指针
Private Sub Form_Load()
Form1.ScaleLeft = -2000
Form1.ScaleTop = 1500
Form1.ScaleWidth = 4000
Form1.ScaleHeight = -3000
End Sub

Private Sub Timer1_Timer()
d = 1400
s = Second(Time)
a = d * Sin(PI * s / 30)
b = d * Cos(PI * s / 30)
c = 50
e = (b + c) * a * b / (a * a + b * b)
f = (b + c) * a * a / (a * a + b * b) - c
g = (b - c) * a * b / (a * a + b * b)
h = (b - c) * a * a / (a * a + b * b) + c
Line (0, 0)-(e, f), RGB(255, 0, 0)
Line (e, f)-(a, b), RGB(255, 0, 0)
Line (a, b)-(g, h), RGB(255, 0, 0)
Line (g, h)-(0, 0), RGB(255, 0, 0)
End Sub
展开
 我来答
zx001z7d53
2011-12-05 · TA获得超过2万个赞
知道大有可为答主
回答量:2.4万
采纳率:52%
帮助的人:5634万
展开全部
Const pi = 3.14159265
Private Const sLeng = 80
Private Const mLeng = 70
Private Const hLeng = 40
Dim s As Integer
Dim m As Integer
Dim h As Single

Private Sub Form_Load()
Me.AutoRedraw = True
Me.ScaleMode = vbPixels
Me.DrawMode = vbNotXorPen
End Sub

Private Sub Form_Resize()
On Error GoTo errMsg:
Me.Scale (-Me.ScaleWidth / 2, -Me.ScaleHeight / 2)-(Me.ScaleWidth / 2, Me.ScaleHeight / 2)
Cls
Me.DrawWidth = 1
Circle (0, 0), 100
Form1.Caption = Format(Time, "medium time")
s = Second(Time)
m = Minute(Time)
h = Hour(Time) + m / 60
If h >= 12 Then h = h - 12
Line (0, 0)-(sLeng * Cos(pi * s / 30), sLeng * Sin(pi * s / 30)), vbRed
Line (0, 0)-(mLeng * Cos(pi * m / 30), mLeng * Sin(pi * m / 30)), vbBlue
Line (0, 0)-(hLeng * Cos(pi * h / 6), hLeng * Sin(pi * h / 6)), vbBlack
Exit Sub
errMsg:
Me.Caption = "窗体被你拖得太小啦!"
End Sub

Private Sub Timer1_Timer()
Line (0, 0)-(sLeng * Cos(pi * s / 30), sLeng * Sin(pi * s / 30)), vbRed
Line (0, 0)-(mLeng * Cos(pi * m / 30), mLeng * Sin(pi * m / 30)), vbBlue
Line (0, 0)-(hLeng * Cos(pi * h / 6), hLeng * Sin(pi * h / 6)), vbBlack
Form1.Caption = Format(Time, "medium time")
s = Second(Time)
m = Minute(Time)
h = Hour(Time) + m / 60
If h >= 12 Then h = h - 12
Line (0, 0)-(sLeng * Cos(pi * s / 30), sLeng * Sin(pi * s / 30)), vbRed '秒针
Line (0, 0)-(mLeng * Cos(pi * m / 30), mLeng * Sin(pi * m / 30)), vbBlue '分针
Line (0, 0)-(hLeng * Cos(pi * h / 6), hLeng * Sin(pi * h / 6)), vbBlack '时针
End Sub
a771313528
2011-12-05 · 超过11用户采纳过TA的回答
知道答主
回答量:84
采纳率:0%
帮助的人:43.9万
展开全部
图片框!!!!
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式