Question
Code the reverse name button's click event procedure to display the name as follows: the last name followed by a comma, a space, and the
Code the reverse name button's click event procedure to display the name as follows: the last name followed by a comma, a space, and the first name.
Here is my code what am I missing?
Option Explicit On Option Strict On
Public Class MainForm
Private Sub reverseButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles reverseButton.Click Dim fullname As String = nameTextBox.Text Dim index As Integer = fullname.IndexOf("") Dim firstname As String = fullname.Substring(0, index) Dim lastname As String = fullname.Substring(index + 1) nameLabel.Text = lastname & "," & lastname
End Sub
Private Sub exitButton_Click(sender As Object, e As EventArgs) Handles exitButton.Click Me.Close() End Sub
Private Sub nameTextBox_Enter(sender As Object, e As EventArgs) Handles nameTextBox.Enter nameTextBox.SelectAll() End Sub
Private Sub nameTextBox_TextChanged(sender As Object, e As EventArgs) Handles nameTextBox.TextChanged nameLabel.Text = String.Empty End Sub
End Class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started