Setting focus in AppDesigner
Ältere Kommentare anzeigen
I'm setting a TextArea object to be editable with a menu selection to allow a field to be updated by the user.
The callaback to do so works fine but it is annoying to have to manually select the text area to get it to have focus and then do the edits.
Is there any way programmatically for the menu callback function to shift focus to the textarea object?
This is in an AppDesigner application.
Antworten (2)
Adam Danz
am 5 Apr. 2022
2 Stimmen
> Is there any way programmatically for the menu callback function to shift focus to the textarea object?
Yes, starting in MATLAB R2022a.
Use the new focus(c) function to set focus to a ui component c. This MATLAB release also provides additional resources to control the focus order of ui components in AppDesigner.
More info
Kevin Holly
am 29 Sep. 2021
0 Stimmen
I found this question here: https://www.mathworks.com/matlabcentral/answers/353504-give-focus-to-an-edit-field
5 Kommentare
dpb
am 29 Sep. 2021
Tomas Ulrich
am 2 Jan. 2022
What are the workarounds for this?
dpb
am 3 Jan. 2022
Sean de Wolski
am 3 Jan. 2022
You may be interested in the R2022a prerelease. And while you're looking at it, you may be interested in typing >>doc focus
dpb
am 3 Jan. 2022
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!