Fix Following Statement Dim Lastname String Txblastnametext Dim Firstname String Txbfirstn Q37158173

Fix the following if statement

Dim LastName As String = TxbLastName.Text
Dim FirstName As String = TxbFirstName.Text
If LastName = TxbLastName.Text Then

If FirstName = TxbFirstName.Text Then
MessageBox.Show(“Complete User’s Information”)
Else
If Integer.TryParse(TxbAge.Text, Age) Then
If Age < 15 Or Age > 90 Then
MessageBox.Show(“Age number must be at least from 15 to 90 yearsold.”,
“Invalid Number”,
MessageBoxButtons.OK, MessageBoxIcon.Information)
Else

BtnClear.Enabled = True
LtbAge.Items.Add(TxbAge.Text)
TxbAge.Text = ” “
LtbLastName.Items.Add(TxbLastName.Text)
TxbLastName.Focus()
TxbLastName.Text = ” “
LtbFristName.Items.Add(TxbFirstName.Text)
TxbFirstName.Text = ” “

End If

With TxbAge

.Focus()
.Clear()
End With
End If
End If
Exit Sub

End If

End Sub


Answer


Dear Student ,

As per the requirement submittedabove , kindly find the below solution.

Here a new Windows Forms Applicationin VB is created using Visual Studio 2017 with name”DemoApplication“.This application contains

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.