This Visual Basic code defines a class with a button click event handler that takes user input from a text box, splits it on spaces into an array, capitalizes the first letters of the first and last names, and displays the initials in a label. It extracts the initials from the input string, capitalizes them, and displays the concatenated initials on the label.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
40 views
Exercise 4
This Visual Basic code defines a class with a button click event handler that takes user input from a text box, splits it on spaces into an array, capitalizes the first letters of the first and last names, and displays the initials in a label. It extracts the initials from the input string, capitalizes them, and displays the concatenated initials on the label.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click Dim array As String() = TextBox1.Text.Split(" ") Dim name As String = array(0).Substring(0, 1).ToUpper Dim last As String = array(1).Substring(0, 1).ToUpper