Treba da napravim analogni sat u Visual Basicu 6.
Nasao sam ovaj kode na internetu
Option Explicit
Const T As Double = 57.29577951
Private Sub Form_Load()
Me.Height = 2048
Me.Width = 2048
End Sub
Private Sub Form_Resize()
Me.ScaleHeight = 100
Me.ScaleWidth = 100
End Sub
Private Sub Timer1_Timer()
Dim H As Long, M As Long, S As Long 'time units
Dim Hd As Double, Md As Double, Sd As Double 'Degrees
Dim Hr As Double, Mr As Double, Sr As Double 'Radians
Me.Cls
H = Hour(Time): M = Minute(Time): S = Second(Time)
If H >= 12 Then H = H - 12
Hd = H * 30
Hd = Hd + M / 2
Md = M * 6
Sd = S * 6
Hd = Hd - 90: Md = Md - 90: Sd = Sd - 90
If Hd < 0 Then Hd = Hd + 360
If Md < 0 Then Md = Md + 360
If Sd < 0 Then Sd = Sd + 360
Hr = Hd / T: Mr = Md / T: Sr = Sd / T
Line (50, 50)-(Me.ScaleHeight / 2 + ((Me.ScaleHeight / 2) * 0.5 * Cos(Hr)), Me.ScaleWidth / 2 + ((Me.ScaleHeight / 2) * 0.5 * Sin(Hr))), vbBlack
Line (50, 50)-(Me.ScaleHeight / 2 + ((Me.ScaleHeight / 2) * 0.6 * Cos(Mr)), Me.ScaleWidth / 2 + ((Me.ScaleHeight / 2) * 0.6 * Sin(Mr))), vbBlue
Line (50, 50)-(Me.ScaleHeight / 2 + ((Me.ScaleHeight / 2) * 0.7 * Cos(Sr)), Me.ScaleWidth / 2 + ((Me.ScaleHeight / 2) * 0.7 * Sin(Sr))), vbRed
End Sub
Treba mi pomoc - ako neko moze da mi objasni sta znace ove skracenice kao Me. , Me.Cls, ukratko da mi objasni sta znaci svaka linija u ovom kodu i ako nije problem da mi neko pomogne kako da u formi zakacim sliku sata?
Hvala unaprijed svima na pomoci
dodati code tagovi...
|