Is there a way to make the return key register for a Textfield. I am using
a sub Textfield_1_Change and would like to use the -text for this object to
be used in a search string when the user has hit the return key. As a
first
step, I have been echoing each key press to the dos window, but the return
key seems to have no effect.
Here's a workaround:
Make the Textfield -multiline => 1.
Use the _Change event:
Grab the text whenever the user changes it
Test the text against =~s/\n//g;
Return if this test fails
Restore the text
Do your search
I used to simply check that the text string ended with a \n and then chomp
it and restore the text. But if a user wants to redo the same search, he
might just click anywhere in the textfield and hit enter, so your \n could
be anywhere in the text string.
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx