Page 1 of 1

Keeping a field to one line only?

Posted: Wed Apr 19, 2006 5:28 am
by Garrett
Rev 2.6.1

How on earth do I disable enter and return in a field, or keep it to a single
line field only?

the enterKey and returnKey messages are not working either.

Thanks,
-Garrett

Posted: Wed Apr 19, 2006 9:50 am
by marielle
In a textfield, it is possible to capture the enter event with

Code: Select all

on enterInField
   ...
end enterInField
to have code that works cross platform/cross keyboards it's always best to add

Code: Select all

on returnInField
   enterinfield
end returnInField
Garrett, you are actively coding it seems!? :wink:

Posted: Wed Apr 19, 2006 2:38 pm
by BvG
You can also set the "AutoTab" property (labeled "Tab on return" in the inspector).

Note that you still can paste returns into such a field.

Re: Keeping a field to one line only?

Posted: Wed Apr 19, 2006 6:21 pm
by Garrett
Garrett wrote:the enterKey and returnKey messages are not working either.
How I came up with the two message names above is beyond me, but
enterInField and returnInField do the job. :-)

I needed to catch the enter and return keys so I could active some code,
so the autoTab would not have worked. But thanks a bunch BvG :-)

And thank you also Marielle.

-Garrett