Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
922 B
2
Indexable
Never
Public Class Form1
    Private Sub btnCompare_Click(sender As Object, e As EventArgs) Handles btnCompare.Click
        Dim valueA As Integer
        Dim valueB As Integer
        Dim isValidA As Boolean
        Dim isValidB As Boolean

        isValidA = Integer.TryParse(txtValueA.Text, valueA)
        isValidB = Integer.TryParse(txtValueB.Text, valueB)

        If isValidA AndAlso isValidB Then
            If valueA > valueB Then
                lblResult.Text = "Value A is greater"
            ElseIf valueA < valueB Then
                lblResult.Text = "Value B is greater"
            Else
                lblResult.Text = "Values A and B are equal"
            End If
        Else
            lblResult.Text = "Please enter valid integers for both values"
        End If
    End Sub

    Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
        Me.Close()
    End Sub
End Class