Automatic Capital Letter for 1st Letter??? 
Author Message
 Automatic Capital Letter for 1st Letter???

Hi i was wondering how i would make the first letter that i input into a
text box turn automatically into a Capital Letter???

Thanks in advance



Mon, 02 Sep 2002 03:00:00 GMT  
 Automatic Capital Letter for 1st Letter???
If I understand you correctly, you only want the first character in the
TextBox to be upper case -- and all the following letters, all of them, are
to be lower case. Then try this Change event code for the TextBox:

Private Sub Text1_Change()
  Static InUse As Boolean
  Dim CursorAt As Long
  If Not InUse Then
    InUse = True
    With Text1
      CursorAt = .SelStart
      .Text = LCase(.Text)
      .SelStart = 0
      .SelLength = 1
      .SelText = UCase$(Left$(.Text, 1))
      .SelStart = CursorAt
    End With
    InUse = False
  End If
End Sub

Rick


Quote:
> Hi i was wondering how i would make the first letter that i input into a
> text box turn automatically into a Capital Letter???

> Thanks in advance



Mon, 02 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Automatic Capital Letter for 1st Letter???

2. Capital Letter Conversion

3. Capital letters in Excel

4. How to search for words with capital initial letters

5. Find Capital Letters

6. Allowing me to type chars with no number but Capital LETTERS

7. PROBLEM WITH CAPITAL LETTERS IN BASIC

8. How to search a string for Capital letters?

9. Help with a search for Capital letters???? Please

10. FileListbox that can show capital letters

11. Capital Letters

12. Allowing me to type chars with no number but Capital LETTERS

 

 
Powered by phpBB® Forum Software