Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lower case in a text box...how? Upper case_yes! Lower?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Could anyone help me with this question. I want to put text in a box. Ineed a code, an input mask or whatever to make the email letters in lower case.
Thank you very much for your attention.

ps/how can i search for threads or other ideas on tek-tips?
 
Hi;

In the LostFocus Event of your textbox put the code:

THIS.VALUE = LOWER(THIS.VALUE)

Ed Please let me know if the sugestion(s) I provide are helpful to you.
Sometimes you're the windshield... Sometimes you're the bug.

 
Juan-

Try something like this example from the command window.

STORE 'MYNAME@ATT.NET' TO lcName
?LOWER(lcname)

From the VFP Help:

LOWER( ) converts all uppercase letters (A – Z) in the character expression to lowercase (a – z). All other characters in the character expression remain unchanged.

Also you might want to use the help index and search for keywords, i.e., Upper, Lower, etc..

This site contains a wealth of information. Select the Keyword Search Tab and enter your key word. A search for lowercase returned a good example of the inverse on Lower(), Upper():

THREAD184-83959

Jack
 
I might add that generally I use the advanced search feature (underlined to the top right of the page because I want to click the 'all words' and only my forums options and sometimes make other changes as well. Dave Dardinger
 
This might be a little more complex than necessary, but I would do it this way. Put this code into the textbox KeyPress() event:
Code:
LPARAMETERS nKeyCode, nShiftAltCtrl
IF BETWEEN(nKeyCode,65,90)
    NODEFAULT
    KEYBOARD chr(nKeyCode+32)
ENDIF
This watches for uppercase letters, prevents them from entering the keyboard buffer, and stuffs the lowercase equivalent into the buffer in its place. This will create the illusion of a lowercase InputMask.

Ian
 
Better still, put the code below in the
keypress event

LPARAMETERS nKeyCode, nShiftAltCtrl

IF NKEYCODE > 64 .AND. NKEYCODE < 91
* make the keystroke uppercase
NKEYCODE = NKEYCODE +32
* tell the edit bix to do it's stuff
* (using the LOWER case version)
DODEFAULT(NKEYCODE,NSHIFTALTCTRL)
* tell it to ignore the original!
NODEFAULT
ENDIF

Regards
Griff ;-)
PS - THIS IS THE WAY YOU DO IT FOR AN EDIT BOX AS WELL.
 
HI

Create a property at the form level called &quot;lCapsLock&quot; and initialise its value to .t. or .f.

myTextBox.GotFocusEvent
***********************
ThisForm.lCapsLock=CAPSLOCK()
CAPSLOCK(.F.)

myTextBox.LostFocusEvent
************************
IF ThisForm.lCapsLock
CAPSLOCK(.T.)
ENDIF

This will take care of the typing while retaining the posibility to key in Caps also.

:) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Griff's code overcomes a limitation in mine: if the system is too slow to process the keystrokes as they come in, they can end up being processed in the wrong order.

I would use Griff's code instead of mine. :eek:)

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top