CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2001
    Posts
    16

    Convert the lowerc ase first letter in a Name to upper letter.

    HI All,

    I've a text control that allows a user to type in their name. How do I convert their first letter of their name in lowercase to uppercase automatically, soon as they tab to the next field.

    Thanks in advance!

    Beth


  2. #2
    Join Date
    Aug 2000
    Location
    Ottawa, Canada
    Posts
    469

    Re: Convert the lowerc ase first letter in a Name to upper letter.

    Assume your text box name is "Text1".

    private Sub Text1_LostFocus()
    Dim strTemp as string
    strTemp = Text1.Text
    mid(strTemp, 1, 1) = UCase(Left(Text1.Text, 1))
    Text1.Text = strTemp
    End Sub





  3. #3
    Join Date
    Jan 2000
    Location
    Saskatchewan, Canada
    Posts
    595

    Re: Convert the lowerc ase first letter in a Name to upper letter.

    Text1 = StrConv(Text1, vbProperCase)

    David Paulson


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured