Please assist in Formatting the input text to upper and lower cases
e.g Start with a capital.
Thanks.

may be this will help you
// Convert to upper case
String upper = string.toUpperCase();

// Convert to lower case
String lower = string.toLowerCase();

try this one. if you have a textbox for the user input, it will look like this

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim myVar As String
        myVar = TextBox1.Text.ToUpper 'if changing to lower case just use .tolower
        MsgBox(myVar)
    End Sub

or you can change it after assigning textbox1 to myVar

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim myVar As String
        myVar = TextBox1.Text
        myVar = myVar.ToUpper
        MsgBox(myVar)
    End Sub

>>e.g Start with a capital.

With TextBox1
            .Text = StrConv(.Text, VbStrConv.ProperCase)
        End With

have tried but it converts the whole text to upper case. i would like to convert the first letter only.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim myVar As String
        myVar = TextBox1.Text.ToUpper 'if changing to lower case just use .tolower
        TextBox1.Text = (myVar)
    End Sub

any further assistance is more great to me.thanks

Edited 5 Years Ago by Ezzaral: Added code tags. Please use them to format any code that you post.

Please try:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim myVar As String
    myVar = Strings.StrConv(TextBox1.Text, VbStrConv.ProperCase)
    TextBox1.Text = myVar
End Sub

try this:

Dim exampe As String = "this is text."
Dim bigLetter As String = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(exampe)

I am greatfull to you all pals.have got the solution.i tried the one from lolafuertes and it worked.thanks alot be blessed.do you have something on print priviewing and printing listview to help please?

This question has already been answered. Start a new discussion instead.