Formulario de comparación

-Creamos el formulario que nos permitirá comparar dos valores.

formulario comparación

-Insertamos la configuración para los distintos botones.

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim igual As Boolean                  'Creamos la variable igual.
        igual = TextBox1.Text = TextBox2.Text 'Asignamos los valores introducidos en las cajas de texto y las comparamos.
        MsgBox(igual)                         'Mostramos en pantalla el resultado obtenido.
    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        Dim mayorigual As Boolean
        mayorigual = TextBox1.Text >= TextBox2.Text
        MsgBox(mayorigual)
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim mayor As Boolean
        mayor = TextBox1.Text > TextBox2.Text
        MsgBox(mayor)
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Dim menor As Boolean
        menor = TextBox1.Text < TextBox2.Text
        MsgBox(menor)
    End Sub

    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
        Dim menorigual As Boolean
        menorigual = TextBox1.Text <= TextBox2.Text
        MsgBox(menorigual)
    End Sub

    Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
        Dim distinto As Boolean
        distinto = TextBox1.Text  TextBox2.Text
        MsgBox(distinto)
    End Sub
End Class

ejercicio comparacion

La Coruña, España Correo contacto@pc-solucion.es