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

Recommended Answers

All 8 Replies

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

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.