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
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist