You can also change the style of the TextBox so that it automatically changes all characters to lower case as they are typed. This will also change the characters that are pasted into the control.VB Code:
Private Declare Function SetWindowLong _ Lib "user32.dll" Alias "SetWindowLongA" ( _ ByVal hwnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Private Declare Function GetWindowLong Lib "user32.dll" _ Alias "GetWindowLongA" ( _ ByVal hwnd As Long, _ ByVal nIndex As Long) As Long Private Const GWL_STYLE As Long = -16 Private Const ES_LOWERCASE As Long = &H10& Private Sub Form_Load() Dim nStyle As Long nStyle = GetWindowLong(Text1.hwnd, GWL_STYLE) Or ES_LOWERCASE Call SetWindowLong(Text1.hwnd, GWL_STYLE, nStyle) End Sub




Reply With Quote