| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 448 人关注过本帖
标题:指针式时钟 不明白怎么该
只看楼主 加入收藏
insoyang
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-5-5
结帖率:0
收藏
已结贴  问题点数:10 回复次数:3 
指针式时钟 不明白怎么该
Private Sub Form_Load()
    pi = 3.14159265358979
    cx = Me.ScaleWidth / 2
    cy = Me.ScaleHeight / 2
    Scale (-cx, cy)-(cx, -cy)
    For I = 1 To 12
        alf = pi * (I - 1) / 6
        Load Line4(I)
        Line4(I).X1 = 1000 * Cos(alf)
        Line4(I).Y1 = 1000 * Cos(alf)
        Line4(I).X2 = 1200 * Cos(alf)
        Line4(I).Y2 = 1200 * Cos(alf)
        Line4(I).Visible = Ture
        Next I
End Sub

Private Sub Form_Paint()
    Circle (0, 0), 1400
End Sub

Private Sub Timer1_Timer()
    hh = Hour(Time) Mod 12
    mm = Minute(Time)
    ss = Second(Time)
    alf = ss * pi / 30 + pi / 2
    Line3.X1 = 100 * Cos(alf)
    Line3.Y1 = -100 * Sin(alf)
    Line3.X2 = 1000 * Cos(alf - pi)
    Line3.Y2 = -1000 * Sin(alf - pi)
    alf = mm * pi / 30 + pi / 2
    Line2.X1 = 100 * Cos(alf)
    Line2.Y1 = -100 * Sin(alf)
    Line2.X2 = 900 * Cos(alf - pi)
    Line2.Y2 = -900 * Sin(alf - pi)
    alf = hh * pi / 6 + mm * pi / 360 + pi / 2
    Line1.X1 = 100 * Cos(alf)
    Line1.Y1 = -100 * Sin(alf)
    Line1.X2 = 700 * Cos(alf - pi)
    Line1.Y2 = -700 * Sin(alf - pi)   
End Sub
图片附件: 游客没有浏览图片的权限,请 登录注册
Private Sub Form_Load()
    pi = 3.14159265358979
    cx = Me.ScaleWidth / 2
    cy = Me.ScaleHeight / 2
    Scale (-cx, cy)-(cx, -cy)
    For I = 1 To 12
        alf = pi * (I - 1) / 6
        Load Line4(I)
        Line4(I).X1 = 1000 * Cos(alf)
        Line4(I).Y1 = 1000 * Cos(alf)
        Line4(I).X2 = 1200 * Cos(alf)
        Line4(I).Y2 = 1200 * Cos(alf)
        Line4(I).Visible = Ture
        Next I
End Sub

Private Sub Form_Paint()
    Circle (0, 0), 1400
End Sub

Private Sub Timer1_Timer()
    hh = Hour(Time) Mod 12
    mm = Minute(Time)
    ss = Second(Time)
    alf = ss * pi / 30 + pi / 2
    Line3.X1 = 100 * Cos(alf)
    Line3.Y1 = -100 * Sin(alf)
    Line3.X2 = 1000 * Cos(alf - pi)
    Line3.Y2 = -1000 * Sin(alf - pi)
    alf = mm * pi / 30 + pi / 2
    Line2.X1 = 100 * Cos(alf)
    Line2.Y1 = -100 * Sin(alf)
    Line2.X2 = 900 * Cos(alf - pi)
    Line2.Y2 = -900 * Sin(alf - pi)
    alf = hh * pi / 6 + mm * pi / 360 + pi / 2
    Line1.X1 = 100 * Cos(alf)
    Line1.Y1 = -100 * Sin(alf)
    Line1.X2 = 700 * Cos(alf - pi)
    Line1.Y2 = -700 * Sin(alf - pi)   
End Sub
搜索更多相关主题的帖子: 1200 
2011-05-17 16:38
lz1091914999
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:四川
等 级:贵宾
威 望:37
帖 子:2011
专家分:5959
注 册:2010-11-1
收藏
得分:3 
这里不是VB论坛,不太喜欢VB这东西。

My life is brilliant
2011-05-17 18:35
laoyang103
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
来 自:内蒙古包头
等 级:贵宾
威 望:19
帖 子:3082
专家分:11056
注 册:2010-5-22
收藏
得分:3 
同上

                                         
===========深入<----------------->浅出============
2011-05-17 21:06
其实、不想说
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:122
专家分:156
注 册:2011-3-3
收藏
得分:3 
一大堆什么东东,看得眼花缭乱
2011-05-17 22:15
快速回复:指针式时钟 不明白怎么该
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.037453 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved