- Version
- Download 80
- File Size 63.73 KB
- File Count 1
- Create Date May 5, 2016
- Last Updated May 5, 2016
Lower, Upper and Proper Case in Visual Basic .Net
Lower, Upper and Proper Case in Visual Basic .Net
This is a vb.net program that will convert your string into all caps, all small letter and in proper case format. Proper case means that it will capitalize the first letter of every word that is separated by space.
Open the project solution (.sln) in visual studio 2010/2012 or open directly the project file (.vbproj)
Source code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If validatefield() = False Then
MessageBox.Show(TextBox1.Text.ToLower())
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If validatefield() = False Then
MessageBox.Show(TextBox1.Text.ToUpper())
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If validatefield() = False Then
MessageBox.Show(Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(TextBox1.Text))
End If
End Sub
Function validatefield() As Boolean
validatefield = True
If TextBox1.Text = "" Then
MessageBox.Show("Please enter a text")
TextBox1.Focus()
Exit Function
End If
validatefield = False
End Function
End Class