Re: Win32lib: Forcing all caps?
>> Anyone know how to force an edit field to only accept all caps?
Try something that goes like this:
atom editflag -- file scope
editflag = 0
...
...
procedure onChange_edittext()
sequence text
if not editflag then
editflag = 1
text=getText(edittext)
text = upper(text)
setText(edittext,text)
else
editflag = 0
end if
end procedure
---------------
The onChange procedure is called for each character typed into the field or
anytime a procedure changed the value of the field. The editflag is used to
prevent an infinite loop. Without it, each change would call the procedure which
would change the field, which would call the procecure ad infinitum. setText and
getText should be self-explanatory, and the upper function in wildcard.e takes a
sequence and converts all the letters to uppercase.
HTH,
Michael J. Sabal
|
Not Categorized, Please Help
|
|