Setting focus in AppDesigner

51 visualizaciones (últimos 30 días)
dpb
dpb el 29 de Sept. de 2021
Respondida: Adam Danz el 5 de Abr. de 2022
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.

Respuestas (2)

Adam Danz
Adam Danz el 5 de Abr. de 2022
> 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
Kevin Holly el 29 de Sept. de 2021
  5 comentarios
Sean de Wolski
Sean de Wolski el 3 de En. de 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
dpb el 3 de En. de 2022
That will be a boon, indeed, @Sean de Wolski.
I generally upgrade only once/year and have pretty-much stayed with a previous year b release...no real reason other than rarely need "bleeding edge", just habit.

Iniciar sesión para comentar.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by