Who can help write Visual Basic code for this problem. s radius squared slself i
ID: 3675246 • Letter: W
Question
Who can help write Visual Basic code for this problem.
Explanation / Answer
Module VBModule
Public Class Form1
Private Sub button1Compare_Click( ByVal sender As System.Object , ByVal e As System.EventArgs ) Handles button1Compare.Click()
' Variables declared
Dim int_A As Integer
Dim int_B As Integer
' Variables are extracted to text
Integer.TryParse(textA.Text, int_A)
Integer.TryParse(textB.Text, int_B)
' Find which number is larger
If Not int_A Then
labelCompare.Text = (" A value isn't a number ")
ElseIf Not int_B Then
labelCompare.Text = (" B value isn't a number ")
ElseIf int_A > int_B Then
labelCompare.Text = (" A value is Greater ")
ElseIf int_A < int_B Then
labelCompare.Text = (" B value is Greater ")
ElseIf int_A = int_B Then
labelCompare.Text = (" The numbers r same ")
End If
If Not int_A Then
labelCompare.Text = (" B value isn't a number ")
End If
End Sub
Private Sub Button2Operaction_Click( ByVal sender As System.Object , ByVal e As System.EventArgs ) Handles Button2Operation.Click()
'Close the form
Me.Close()
End Sub
End Class
End Module
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.