- Home
·
- String Manipulation
·
- Changes first letter of each word in either TextBox or ComboBox into Capital using StrConv.
Changes first letter of each word in either TextBox or ComboBox into Capital using StrConv.
Changes first letter of each word in either TextBox or ComboBox into Capital using StrConv.
Rate Changes first letter of each word in either TextBox or ComboBox into Capital using StrConv.
(2(2 Vote))
Function ccProperCase(MySourceControl As Control)
'-------------------------------------------------------'
'This Function turns first letter of the word '
'into the Uper case if its in the low case. '
'-------------------------------------------------------'
On Error GoTo ErrH
Dim strString As String
strString = MySourceControl.Text
If IsNull(strString) Then Exit Function
strString = StrConv(strString, vbProperCase)
MySourceControl.SelStart = Len(strString)
MySourceControl.Text = strString
Exit Function
ErrH:
MsgBox "Error at ccProperCase:::- " & Err.Number & " - " & Err.Description, vbCritical
Exit Function
End Function
2. Place the ComboBox on your form and Copy this code.
Private Sub Combo1_Change()
Call ccProperCase(Combo1)
End Sub
3. Run the program and try to type something in the ComboBox.
Changes first letter of each word in either TextBox or ComboBox into Capital using StrConv. Comments
No comments yet — be the first to post one!
Post a Comment