Como hago un reloj en visual
Seria de gran ayuda que me puedan ayudar en realizar un programa que me pueda mostrar cuatro relojes con diferentes tiempos por ejemplo de lima, Tokio,Madrid y otro...seria de gran ayuda gracias...
Hola,
necesitas:
4 label
1 Timer
1 command
1 picture
'*****************************************************
'
' RELOJITOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
' By: Serpente (Mingao)
' Fecha: 20-11-2003
' ;-)
'
'*****************************************************
Private Sub Command1_Click()
End
End Sub
Private Sub Timer1_Timer()
Dim AngH, AngM, AngS As Double
Dim CentroX, CentroY As Double
Dim RelojW, RelojH As Double
Const pi = 3.141592
Dim numerosRomanos As String
' Reloj Analógico
AngH = (Hour(Now) + (Minute(Now) / 60)) / 6 * pi
AngM = (Minute(Now) + (Second(Now) / 60)) / 30 * pi
AngS = Second(Now) * (pi / 30)
CentroX = Picture1.Width / 2
CentroY = Picture1.Height / 2
RelojW = Picture1.Width / 2.2
RelojH = Picture1.Height / 2.2
Picture1.Cls
Picture1.Top = 100
Picture1.Left = Me.Width - Picture1.Width - 200
Picture1.DrawWidth = 3
Picture1.Line (CentroX, CentroY)-(CentroX + RelojW * Sin(AngH) * 0.5, CentroY - RelojH * Cos(AngH) * 0.5), RGB(50, 50, 50)
Picture1.DrawWidth = 2
Picture1.Line (CentroX, CentroY)-(CentroX + RelojW * Sin(AngM) * 0.8, CentroY - RelojH * Cos(AngM) * 0.8), RGB(100, 100, 100)
Picture1.DrawWidth = 1
Picture1.Line (CentroX, CentroY)-(CentroX + RelojW * Sin(AngS), CentroY - RelojH * Cos(AngS)), RGB(255, 0, 0)
' Puntos en las horas del reloj
For a = 0 To 11
Picture1.CurrentX = (CentroX + RelojW * Sin(a * pi / 6) * 0.95) - 140
Picture1.CurrentY = (CentroY - RelojH * Cos(a * pi / 6) * 0.95) - 45
Select Case a
Case 0
numerosRomanos = "XII"
Case 1
numerosRomanos = "I"
Case 2
numerosRomanos = "II"
Case 3
numerosRomanos = "III"
Case 4
numerosRomanos = "IV"
Case 5
numerosRomanos = "V"
Case 6
numerosRomanos = "VI"
Case 7
numerosRomanos = "VII"
Case 8
numerosRomanos = "VIII"
Case 9
numerosRomanos = "IX"
Case 10
numerosRomanos = "X"
Case 11
numerosRomanos = "XI"
End Select
'If a = 0 Then
' numeros = 12
'Else
' numeros = a
'End If
Picture1.Print numerosRomanos
'Picture1.Circle (CentroX + RelojW * Sin(a * pi / 6) * 0.95, CentroY - RelojH * Cos(a * pi / 6) * 0.95), 15
If a = 3 Then
' Fecha
Picture1.Circle ((CentroX + RelojW * Sin(a * pi / 6) * 0.95) - 550, (CentroY - RelojH * Cos(a * pi / 6) * 0.95) + 45), 150, RGB(0, 0, 255)
Picture1.CurrentX = CentroX + 700
Picture1.CurrentY = CentroY - 50
Picture1.Print Day(Date)
End If
Next a
' Reloj Digital
' Hora
Label1.Caption = Format(Time, "hh:mm:ss")
' Fecha
Label2.Caption = Date
End Sub
pd.
si quires te lo mando ;-)
salu2
sdemingo
necesitas:
4 label
1 Timer
1 command
1 picture
'*****************************************************
'
' RELOJITOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
' By: Serpente (Mingao)
' Fecha: 20-11-2003
' ;-)
'
'*****************************************************
Private Sub Command1_Click()
End
End Sub
Private Sub Timer1_Timer()
Dim AngH, AngM, AngS As Double
Dim CentroX, CentroY As Double
Dim RelojW, RelojH As Double
Const pi = 3.141592
Dim numerosRomanos As String
' Reloj Analógico
AngH = (Hour(Now) + (Minute(Now) / 60)) / 6 * pi
AngM = (Minute(Now) + (Second(Now) / 60)) / 30 * pi
AngS = Second(Now) * (pi / 30)
CentroX = Picture1.Width / 2
CentroY = Picture1.Height / 2
RelojW = Picture1.Width / 2.2
RelojH = Picture1.Height / 2.2
Picture1.Cls
Picture1.Top = 100
Picture1.Left = Me.Width - Picture1.Width - 200
Picture1.DrawWidth = 3
Picture1.Line (CentroX, CentroY)-(CentroX + RelojW * Sin(AngH) * 0.5, CentroY - RelojH * Cos(AngH) * 0.5), RGB(50, 50, 50)
Picture1.DrawWidth = 2
Picture1.Line (CentroX, CentroY)-(CentroX + RelojW * Sin(AngM) * 0.8, CentroY - RelojH * Cos(AngM) * 0.8), RGB(100, 100, 100)
Picture1.DrawWidth = 1
Picture1.Line (CentroX, CentroY)-(CentroX + RelojW * Sin(AngS), CentroY - RelojH * Cos(AngS)), RGB(255, 0, 0)
' Puntos en las horas del reloj
For a = 0 To 11
Picture1.CurrentX = (CentroX + RelojW * Sin(a * pi / 6) * 0.95) - 140
Picture1.CurrentY = (CentroY - RelojH * Cos(a * pi / 6) * 0.95) - 45
Select Case a
Case 0
numerosRomanos = "XII"
Case 1
numerosRomanos = "I"
Case 2
numerosRomanos = "II"
Case 3
numerosRomanos = "III"
Case 4
numerosRomanos = "IV"
Case 5
numerosRomanos = "V"
Case 6
numerosRomanos = "VI"
Case 7
numerosRomanos = "VII"
Case 8
numerosRomanos = "VIII"
Case 9
numerosRomanos = "IX"
Case 10
numerosRomanos = "X"
Case 11
numerosRomanos = "XI"
End Select
'If a = 0 Then
' numeros = 12
'Else
' numeros = a
'End If
Picture1.Print numerosRomanos
'Picture1.Circle (CentroX + RelojW * Sin(a * pi / 6) * 0.95, CentroY - RelojH * Cos(a * pi / 6) * 0.95), 15
If a = 3 Then
' Fecha
Picture1.Circle ((CentroX + RelojW * Sin(a * pi / 6) * 0.95) - 550, (CentroY - RelojH * Cos(a * pi / 6) * 0.95) + 45), 150, RGB(0, 0, 255)
Picture1.CurrentX = CentroX + 700
Picture1.CurrentY = CentroY - 50
Picture1.Print Day(Date)
End If
Next a
' Reloj Digital
' Hora
Label1.Caption = Format(Time, "hh:mm:ss")
' Fecha
Label2.Caption = Date
End Sub
pd.
si quires te lo mando ;-)
salu2
sdemingo
gracias...pero puedes darme una ayuda mas como por ejemplo un programa y luego yo modificarlo...
en el formulario pone un textbox y un control timer
despues hace doble click en el timer y cuando se te abran los eventos poné text1.text = time si queres eliminar el am/pm poné text1.text = time$ a tenes que cambiar las propiedades del timer de 0 a 1 o 975 que serían las oordenadas justas.
despues hace doble click en el timer y cuando se te abran los eventos poné text1.text = time si queres eliminar el am/pm poné text1.text = time$ a tenes que cambiar las propiedades del timer de 0 a 1 o 975 que serían las oordenadas justas.
