Ver Mensaje Individual
  #5 (permalink)  
Antiguo 12/03/2009, 14:21
oonai
 
Fecha de Ingreso: agosto-2005
Mensajes: 8
Antigüedad: 18 años, 9 meses
Puntos: 0
Respuesta: Gracia

Pregunta para ustedes

diseñe el codigo de esta forma, seguro hay algo mas facil, pero al poner a repetir la funcion da un error

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
fecha()
horas()
End Sub
Sub fecha()
Dim fecha As Date
fecha = Now.AddMinutes(-30)
Dim valorfecha, valorhora As Char
Dim diadelmes As Integer = Now.Day() '1 a 30 ó 31
Dim diadelasemana As Integer = Now.DayOfWeek() '1 al 7 que corresponden a lunes, martes,etc
Dim diadelaño As Integer = Now.DayOfYear() ' 1 a 365
Dim hora As Integer = fecha.Hour() '0 a 59
Dim minutos As Integer = fecha.Minute() '0 a 59
Dim min As Char
txtfecha.Text = Format(fecha, "dd/MM /yyyy")
End Sub
Sub horas()
Dim fecha As Date
fecha = Now.AddMinutes(-30)
Dim hora As Integer = fecha.Hour() '0 a 59
Dim minutos As Integer = fecha.Minute() '0 a 59
Dim min As Char
txthora.Text = hora
Dim hor As Char
Select Case hora
Case 1
hor = "01"
txthora.Text = hor
Case 2
hor = "02"
txthora.Text = hor
Case 3
hor = "03"
txthora.Text = hor
Case 4
hor = "04"
txthora.Text = hor
Case 5
hor = "05"
txthora.Text = hor
Case 5
hor = "06"
txthora.Text = hor
Case 7
hor = "07"
txthora.Text = hor
Case 8
hor = "08"
txthora.Text = hor
Case 9
hor = "09"
txthora.Text = hor
End Select
txtminutos.Text = minutos
Select Case minutos
Case 1
min = "01"
txtminutos.Text = min
Case 2
min = "02"
txtminutos.Text = min
Case 3
min = "03"
txtminutos.Text = min
Case 4
min = "04"
txtminutos.Text = min
Case 5
min = "05"
txtminutos.Text = min
Case 5
min = "06"
txtminutos.Text = min
Case 7
min = "07"
txtminutos.Text = min
Case 8
min = "08"
txtminutos.Text = min
Case 9
min = "09"
txtminutos.Text = min
End Select
'aqui va timeer co 60 seg
'Ahora cuando agrego estas lineas, para repetir la funcion indeterminadamente sin el timer
'da el siguiente EEROR
'Excepción no controlada del tipo 'System.StackOverflowException' en system.windows.forms.dll

'hora = Nothing
'Call horas()

End Sub

que solucion le ven ustedes y como ejecuto el timer que se llama tiempo por 60 seg

MUCHAS GRACIAS Y DISCULPEN LA NOVATADA