tengo un pekeño problema con el code, cuando ago que carge el tiempo guardado del archivo de texto a un text box me carga el numero y luego 2 rallas y por esas 2 rallas no me carga bien el numero , aver si alguien me puede decir porque sale, dejo aqui todo el codigo k tengo echo y la imagen
Private Sub savetext1()
Dim canalLibre As Integer
canalLibre = FreeFile
Open "./tiempo.txt" For Output As #canalLibre
Print #canalLibre, Text1
Close #canalLibre
End Sub
Private Sub savetext2()
Dim canalLibre As Integer
canalLibre = FreeFile
Open "./tiempo2.txt" For Output As #canalLibre
Print #canalLibre, Text2
Close #canalLibre
End Sub
Private Sub savetext3()
Dim canalLibre As Integer
canalLibre = FreeFile
Open "./tiempo3.txt" For Output As #canalLibre
Print #canalLibre, Text3
Close #canalLibre
End Sub
Private Sub Form_Load()
Label1.Caption = Text4.Text
Label2.Caption = Text5.Text
Label3.Caption = Text6.Text
cargartxt1
cargartxt2
cargartxt3
Timer1.Enabled = True
Timer2.Enabled = True
End Sub
Private Sub cargartxt1()
On Error Resume Next
Dim n_File As Integer
Dim Contenido As String
n_File = FreeFile
Open "./tiempo.txt" For Input As n_File
Contenido = Input$(LOF(n_File), #n_File)
Close n_File
Text4 = Contenido
End Sub
Private Sub cargartxt2()
On Error Resume Next
Dim n_File As Integer
Dim Contenido As String
n_File = FreeFile
Open "./tiempo2.txt" For Input As n_File
Contenido = Input$(LOF(n_File), #n_File)
Close n_File
Text5 = Contenido
End Sub
Private Sub cargartxt3()
On Error Resume Next
Dim n_File As Integer
Dim Contenido As String
n_File = FreeFile
Open "./tiempo3.txt" For Input As n_File
Contenido = Input$(LOF(n_File), #n_File)
Close n_File
Text6 = Contenido
End Sub
Private Sub Timer1_Timer()
Label6.Caption = "0"
Label3.Caption = Val(Label3.Caption) + 1
If Val(Label3.Caption) < 10 Then
Label3.Caption = "0" & Label3.Caption
End If
If Val(Label3.Caption) > 59 Then
Label3.Caption = "00"
Label2.Caption = Val(Label2.Caption) + 1
If Val(Label2.Caption) < 10 Then
Label2.Caption = "0" & Label2.Caption
End If
If Val(Label2.Caption) > 59 Then
Label2.Caption = "00"
Label1.Caption = Val(Label1.Caption) + 1
If Val(Label1.Caption) < 10 Then
Label1.Caption = "0" & Label1.Caption
End If
End If
End If
End Sub
Private Sub Timer2_Timer()
Label6.Caption = Val(Label6.Caption) + 1
End Sub
Private Sub Timer3_Timer()
savetext1
savetext2
savetext3
End Sub
Private Sub Timer4_Timer()
Text1.Text = Label1.Caption
Text2.Text = Label2.Caption
Text3.Text = Label3.Caption
End Sub