miércoles, 12 de noviembre de 2008

VALIDAR SI LOS NUMEROS SON IGUALES


Dim num1 As Integer
Dim num2 As Integer

Private Sub Command1_Click()
If num1 = num2 Then
Text3.Text = "LOS NUMEROS SON IGUALES"
ElseIf num1 > num2 Then
Text3.Text = num1
Else
Text3.Text = num2
End If
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.SetFocus
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
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_Change()
If Text2.Text <> " " Then
num2 = Val(Text2.Text)
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

No hay comentarios: