devxlogo

Better Auto-Propercase

Better Auto-Propercase

The “Auto-Propercase Text Box at Entry” tip [VBPJ May 1997, page 63] has a simpler solution. The StrConv function can propercase any string. You can achieve the same effect with this code in the KeyUp event of a text box:

 Private Sub Text1_KeyUp(KeyCode As Integer, _	Shift As Integer)	Dim iCurPos As Integer	iCurPos = Text1.SelStart	Text1.Text = StrConv(Text1, vbProperCase)	Text1.SelStart = iCurPosEnd Sub

devx-admin

Share the Post: