CodeItBetter Programming Another VB Programming Blog

How to make propercase when entering the text in a text box

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'Controls - How to make propercase when entering the text in a text box
Public Function fnMakeProperCase(txtBox As TextBox)
    'To convert the text to Proper case
    Dim lngSelStart As Long, lngSelLength As Long
    With txtBox
        lngSelStart = .SelStart
        lngSelLength = .SelLength
        .Text = StrConv(.Text, vbProperCase)
        .SelStart = lngSelStart
        .SelLength = lngSelLength
    End With
End Function
 
'How can I call this function:
'Private Sub Text1_Change()
'Call fnMakeProperCase(Text1)
'End Sub

Related posts:

  1. How to make uppercase when entering the text in a text box
  2. How to make lowercase when entering the text in a text box
  3. How to select the content of text box when entering into it.
  4. How to Search for a word in a Text box.
  5. How to Prevent the user from entering invalid keys in a text box.
  6. How to select all text with Ctrl+A in a text box
  7. How to color the words in Rich Text box automatically like VB Editor?
  8. How to make Sentence Case
  9. How to Link a text box to a list box? So, as you type, it highlights any matching entries
  10. How to select all text with Ctrl+A in all TextBoxes in a form

Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.