- 最後登錄
- 2024-9-17
- 在線時間
- 37 小時
- 註冊時間
- 2009-9-18
- 閱讀權限
- 20
- 精華
- 0
- UID
- 7034376
- 帖子
- 73
- 積分
- 22 點
- 潛水值
- 8184 米
| 所有積分大於負-100的壞孩子,將可獲得重新機會成為懲罰生,權限跟幼兒生一樣。 10幾年前用VB6寫的指針事時鐘,你參考看看- '表單放置1個Timer及1個VScrollBar
- Const Pi = 3.14159265358979
- Dim X&, Y&, R&, Hh%, Mm%, Ss%
- Private Sub Form_Load()
- Dim A&, B&, I%, J$, W%, H%
-
- X = ScaleWidth \ 2: Y = ScaleHeight \ 2
- R = X: If Y < X Then R = Y
- R = R - 120
- AutoRedraw = True: DrawWidth = 1: ForeColor = 0
- J = 255
- For I = R To R + 90
- Circle (X, Y), I, RGB(J, 0, J)
- J = J - 1
- Next
- J = 1
- For I = 210 To 540 Step 30
- W = TextWidth(J) \ 2
- H = TextHeight(J) \ 2
- CurrentX = X - Sin(I / 180 * Pi) * (R - W * 2) - W
- CurrentY = Y + Cos(I / 180 * Pi) * (R - H * 2) - H
- Print J: J = J + 1
- Next
- R = R - H * 3
- Picture = Image
- VScroll1.Max = 1000: VScroll1.Min = 10: VScroll1 = 1000
- Hh = Hour(Now): Mm = Minute(Now): Ss = Second(Now)
- Timer1.Enabled = True
- End Sub
- Private Sub Timer1_Timer()
- Dim S%, I%, J%
-
- Cls
-
- DrawWidth = 4
- S = ((Hh Mod 12) + Mm / 60) * 30 + 180
- I = X - Sin(S / 180 * Pi) * R * 0.6
- J = Y + Cos(S / 180 * Pi) * R * 0.6
- Line (X, Y)-(I, J)
- DrawWidth = 2
- S = Mm * 6 + 180
- I = X - Sin(S / 180 * Pi) * R * 0.8
- J = Y + Cos(S / 180 * Pi) * R * 0.8
- Line (X, Y)-(I, J)
- DrawWidth = 1
- S = Ss * 6 + 180
- I = X - Sin(S / 180 * Pi) * R
- J = Y + Cos(S / 180 * Pi) * R
- Line (X, Y)-(I, J)
- Ss = Ss + 1
- If Ss > 59 Then Mm = Mm + 1: Ss = 0
- If Mm > 59 Then Hh = Hh + 1: Mm = 0
- If Hh > 12 Then Hh = 1
-
- End Sub
- Private Sub VScroll1_Change()
- Timer1.Interval = VScroll1
- End Sub
- Private Sub VScroll1_Scroll()
- Timer1.Interval = VScroll1
- End Sub
複製代碼 ... |
|