displaying contents while entering in text box only not after pressing enter key
2 次查看(过去 30 天)
显示 更早的评论
i have a text box if i type a then a should be displayed without pressing the enter key
similarly if i type ab then ab should be displayed without pressing the enter key
how do i write callback for this
Thanks in advance
0 个评论
采纳的回答
Image Analyst
2013-8-30
If you use GUIDE and double click your text edit box you'll bring up the property inspector. In there you'll see a callback for the key press function. Click the icon for that to go to the code for that. In there, get the text from the edit box and do something with it, such as display it in a static text label:
editTextString = get(handles.editText, 'String');
set(handles.staticText, 'String', editTextString);
0 个评论
更多回答(1 个)
Jan
2013-8-30
This seems like the standard for uicontrol of type edit. Please explain exactly, what you mean by "text box".
Perhaps you mean a text object (see "help text"), which is updated by the WindowsKeyPressFcn, which is a property of the parent figure.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!