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

채택된 답변

Image Analyst
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);

추가 답변 (1개)

Jan
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.
  댓글 수: 2
shaz
shaz 2013년 8월 30일
편집: shaz 2013년 8월 30일
yes it is a uicontrol of type edit
if i type any letters in edit text box i need to display the same letters without pressing enter key

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by