devxlogo

Enforce Uppercase Characters

Enforce Uppercase Characters

Do you want to facilitate the user to enter only uppercase charactersduring editing in text boxes and other edit controls? Irrespectiveof the position of CAPS LOCK key, this code in the KeyPress eventof the Form will force the user always to enter uppercase characters.

 Private Sub Form_KeyPress(KeyAscii _        As Integer)KeyAscii = Asc(UCase(Chr(KeyAscii)))End Sub

For this code to work, you need to set the KeyPreview propertyof the Form to True.

See also  Professionalism Starts in Your Inbox: Keys to Presenting Your Best Self in Email
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