Hello,
I have a TextEntry field and want to finish the entry with ENTER. How can I achieve that my actions begin to work after pressing the ENTER key?
Finish Text Enty Field With Enter Key
Moderator: Neosoft Support
- Horst Helfen
- Posts: 100
- Joined: Thu May 05, 2005 4:11 am
- Location: Hamburg, Germany
- Contact:
Finish Text Enty Field With Enter Key
Horst Helfen
Programmers don't die, they just GOSUB without RETURN.
Programmers don't die, they just GOSUB without RETURN.
Re: Finish Text Enty Field With Enter Key
Horst Helfen:
If you define the style of your TextEntry box as a Multiline (no Scroll bars, no Word wrap) ... and make its height just enough to show one line of text ... in other words, make it look (to the user) like a singleline box ... then you can use code like this in the Text Change event section ...
If you define the style of your TextEntry box as a Multiline (no Scroll bars, no Word wrap) ... and make its height just enough to show one line of text ... in other words, make it look (to the user) like a singleline box ... then you can use code like this in the Text Change event section ...
Code: Select all
SearchStr "[#13][#10]" "[TextEntry1]" "[EnterKeyPos]" ""
If "[EnterKeyPos]" ">" "0"
StrReplace "[TextEntry1]" "[#13][#10]" "" "[TextEntry1]" ""
... do Enter key processing here
AlertBox "Info" "Enter Key was pressed"
EndIf
- Horst Helfen
- Posts: 100
- Joined: Thu May 05, 2005 4:11 am
- Location: Hamburg, Germany
- Contact:
Re: Finish Text Enty Field With Enter Key
Thank you Gaev for your quick answer. That works fine.
Horst Helfen
Programmers don't die, they just GOSUB without RETURN.
Programmers don't die, they just GOSUB without RETURN.
Re: Finish Text Enty Field With Enter Key
Tray this
Code: Select all
{NeoBook 5 Objects}
NeoBookVer=5,80
ObjectType=9
Name=TexEnt
X=34
Y=73
W=283
H=133
Anchor=0
VarName=[Tx]
Align=1
EditMultiLine=Yes
EditLen=0
ObjAction=GetObjectInfo "TexEnt" "CursorPosition" "[ps]"¶substr "[tx]" "[ps]-1" "1" "[ch]"¶if "[ch]" "=" "[#10]"¶ alertbox "" "enter.."¶endif
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=7
COSTA RICA
PURA VIDA
PURA VIDA