martes, 11 de noviembre de 2008

CALCULAR LOS SEGUNDOS RESTANTES

Dim num1, resp, resp2 As Double

Private Sub Command1_Click()
If num1 Mod 60 = 0 Then
resp2 = num1 / 60
Label2.Caption = "Hay " & resp2 & " minuto(s)"
Else
resp = -(num1 Mod 60) + 60
If (num1 Mod 60) = 0 Then
resp2 = ((resp + num1) / 60)
Else
resp2 = ((resp + num1) / 60)
End If
Label2.Caption = "Faltan " & resp & " segundos para completar " & resp2 & " minuto(s)"
End If
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Label2.Caption = " "
Text1.SetFocus
num1 = 0
resp = 0
End Sub

Private Sub Command3_Click()
End
End Sub





Private Sub Text1_Change()
If Text1.Text <> " " Then
num1 = Val(Text1.Text)
End If
End Sub

No hay comentarios: