Easy question for editbox?
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
Hello,
I am using edit box as an input window. When user click enter button callback of the edit box runs and takes the input. And in order to change the text of edit box I need to select the editbox again. Is there code that I can add and of callback, it selects edit box instead of me.
Antworten (1)
Image Analyst
am 14 Dez. 2013
You don't need to "select" it. You just use the set() function to send a string to it.
set(handles.edit1, 'String', yourString);
4 Kommentare
Volkan Kandemir
am 14 Dez. 2013
Bearbeitet: Image Analyst
am 14 Dez. 2013
Image Analyst
am 14 Dez. 2013
Put whatever you want to do into the keypress event. Check if the key is enter and if it is, do your stuff.
Volkan Kandemir
am 15 Dez. 2013
Image Analyst
am 15 Dez. 2013
What do you mean by "select"? Do you mean to highlight the text that is in there so that if the user types a character the whole contents are replaced by what he typed? Or do you mean that it just has focus? If it's the former you'll have to look to some java code. Try http://undocumentedmatlab.com/blog/customizing-editboxes/ - that will show you how to do it.
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!