Unable to clear editField more than once

조회 수: 1 (최근 30일)
Max
Max 2024년 4월 24일
답변: Neha 2024년 5월 6일
I am creating a typing test on the MatLab AppDesigner. I have simplified it down to a core problem. I have placed an EditField on the screen and have created this code for the function EditFieldValueChanging(app,event):
currentText = event.Value;
if contains(currentText,'test')
app.EditField.Value = ' ';
disp('good job')
end
I have two issues: firstly, I cannot set the app.EditField.Value to nothing (i.e. ''). I tried this with a TextArea and it did work however, so I have found a workaround. Secondly and the main issue, is that once it clears the text, it only works once. If I type 'hello' again into the text box, it displays 'good job' but does not clear the text the second time around. I really appreciate any help.

답변 (1개)

Neha
Neha 2024년 5월 6일
Hi Max,
I understand you are facing an issue while clearing 'EditField' object's value in MATLAB App Designer.
To help you work around this issue, you might consider trying either of the following suggestions:
  • Change the window focus mode to "click" instead of "mouse" in the settings.
  • Switch the desktop environment to XFCE.
Hope this helps!

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by