Notifications
Clear all

[Closed] About entered event in edittxt

Hello, I have qustion.
I write text using edittext function, And I set event “entered”.
I thought the code is responce only push enter key. But the code is responding for mousclick event too…

How I can solve this problem?
Anyone could help me? Thank you

try (destroydialog mydialog) catch()
rollout mydialog "txtbox" width:180
(
	edittext edt_name "txt"
	on edt_name entered tmp do
	(
		print "Hello"
		edt_name.text = ""
	)
)
createdialog mydialog

2 Replies

from the reference

‘on entered’ handlers are called when the edit box loses keyboard focus, such as if you tab or click out of the edit box.

you can use
createdialog mydialog modal:true
to keep it in focus

or use a dotnet textbox and do this

on TextBox KeyUp s e do ( if e.KeyCode == e.KeyCode.Enter do (–your things here–))

Thank you sir!! It worked.