Dim num1, m, h, d As Integer
Private Sub Command1_Click()
If Text1.Text <> " " Then
If num1 \ 60 = 0 And num1 \ 1440 = 0 Then
m = num1
Label2.Caption = "Hay " & m & " minutos"
ElseIf num1 \ 60 <> 0 And num1 \ 1440 = 0 Then
If num1 Mod 60 = 0 Then
h = num1 / 60
Label2.Caption = "Hay " & h & " horas"
Else
h = num1 \ 60
m = num1 Mod 60
Label2.Caption = "Hay " & h & " horas" & " con " & m & " minutos"
End If
ElseIf num1 \ 60 <> 0 And num1 \ 1440 <> 0 Then
If num1 Mod 1440 = 0 Then
d = num1 \ 1440
Label2.Caption = "Hay " & d & " dias"
ElseIf num1 Mod 1440 <> 0 And (num1 Mod 1440) Mod 60 = 0 Then
d = num1 \ 1440
h = (num1 Mod 1440) \ 60
Label2.Caption = "Hay " & d & " dia(s)" & " con " & h & " hora(s)"
ElseIf num1 Mod 1440 <> 0 And (num1 Mod 1440) Mod 60 <> 0 Then
d = num1 \ 1440
h = (num1 Mod 1440) \ 60
m = (num1 Mod 1440) Mod 60
Label2.Caption = "Hay " & d & " dia(s)" & " con " & h & " hora(s) y " & m & " minuto(s)"
End If
End If
Else
MsgBox ("Ingrese un numero")
Text1.SetFocus
End If
End Sub
Private Sub Command2_Click()
Text1.Text = " "
Label2.Caption = " "
Text1.SetFocus
num1 = 0
m = 0
d = 0
h = 0
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Text1.Text = " "
End Sub
Private Sub Text1_Change()
If Text1.Text <> " " Then
num1 = Val(Text1.Text)
End If
End Sub