ORDENADOR DE TRES NUMEROS
Este programa muestra el orden ascendente de tres números ingresados por el usuario
Este programa muestra el orden ascendente de tres números ingresados por el usuario
CODIGO_______________________________________________________________
Private Sub Command1_Click()
'boton calcular, en el cual realiza toda comparación posible
If Val(Text1.Text) > Val(Text2.Text) Then
If Val(Text1.Text) > Val(Text3.Text) Then
Label2.Caption = Text1.Text
Label3.Caption = Text3.Text
Label4.Caption = Text2.Text
Else
Label2.Caption = Text3.Text
Label3.Caption = Text1.Text
Label4.Caption = Text2.Text
End If
Else
If Val(Text2.Text) > Val(Text3.Text) Then
Label2.Caption = Text2.Text
Label3.Caption = Text3.Text
Label4.Caption = Text1.Text
Else
Label2.Caption = Text3.Text
Label3.Caption = Text2.Text
Label4.Caption = Text1.Text
End If
End If
End Sub
Private Sub Command2_Click()
'boton borrar
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label2.Caption = ""
Label3.Caption = ""
Label4.Caption = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
boton salir
End
End Sub
Private Sub Command1_Click()
'boton calcular, en el cual realiza toda comparación posible
If Val(Text1.Text) > Val(Text2.Text) Then
If Val(Text1.Text) > Val(Text3.Text) Then
Label2.Caption = Text1.Text
Label3.Caption = Text3.Text
Label4.Caption = Text2.Text
Else
Label2.Caption = Text3.Text
Label3.Caption = Text1.Text
Label4.Caption = Text2.Text
End If
Else
If Val(Text2.Text) > Val(Text3.Text) Then
Label2.Caption = Text2.Text
Label3.Caption = Text3.Text
Label4.Caption = Text1.Text
Else
Label2.Caption = Text3.Text
Label3.Caption = Text2.Text
Label4.Caption = Text1.Text
End If
End If
End Sub
Private Sub Command2_Click()
'boton borrar
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label2.Caption = ""
Label3.Caption = ""
Label4.Caption = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
boton salir
End
End Sub