PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Petrus Vorster on April 05, 2016, 08:35:03 AM

Title: Firetextbox Uppercase characters
Post by: Petrus Vorster on April 05, 2016, 08:35:03 AM
Is there a way to make a firetextbox only upper or lower text characters by default?
Title: Re: Firetextbox Uppercase characters
Post by: Paul Squires on April 06, 2016, 10:48:08 AM
Hi Peter,

It has been a loooooooong time since I worked with the FireTextBox code, but the code below should help you filter out uppcase letters. You can easily modify the SELECT CASE to filter out whatever you don't want.

'--------------------------------------------------------------------------------
Function FORM1_FIRETEXTBOX1_FIRETEXTBOX_MSG_KEYPRESS (ControlIndex As Long, hWndForm As Dword, hWndControl As Dword, idTextControl As Long, pKeyPressNotify As Dword) As Long

   Dim pKey As FIRETEXTBOX_KEYPRESS Ptr
   
   pKey = pKeyPressNotify
   
   Select Case @pKey.nKeyPress
      Case 65 To 90    ' all uppercase letters
         ' cancel the input of the uppercase letter
         Function = 1: Exit Function
   End Select     
   
   Function = 0   ' change according to your needs
End Function

Title: Re: Firetextbox Uppercase characters
Post by: Petrus Vorster on April 06, 2016, 05:03:10 PM
Thanks, yes i had something like this going. I just thought it could be done like a normal textbox.
I kind of like the fire-textbox's line and looks.