How can I keep my app in front on the screen?

34 visualizaciones (últimos 30 días)
Gavin
Gavin el 24 de Oct. de 2024
Comentada: Gavin el 27 de En. de 2025
When certain functions are called such as uigetfile() or uigetdir() after the file or directory is chosen the AD generated app goes behind other windows that may be on the screen. How can I bring it back to the front?
figure(app.MyApp);
didn't work.
Also pressing enter rather than mouse clicking to get the default can result in the next popup query [ uiconfirm() or uigetfile() ] coming up behind the application and thus not responding to the enter key. Focus has been lost!
  1 comentario
Walter Roberson
Walter Roberson el 25 de Oct. de 2024
A few other people have reported this problem.
Unfortunately I do not recall any solutions having been posted.

Iniciar sesión para comentar.

Respuestas (1)

Taylor
Taylor el 28 de Oct. de 2024
In App Designer, select your UIFigure in the component browser. set the WindowStyle to "alwaysontop".
Alternatively, you can use the focus command.
  3 comentarios
Taylor
Taylor el 27 de En. de 2025
Calling focus(app.UIFigure) after uigetfile returns the main app window to the top for me in R2024b. Have you tried this function?
Gavin
Gavin el 27 de En. de 2025
No I was using figure(app.UIfig) I'll try focus()

Iniciar sesión para comentar.

Categorías

Más información sobre App Building en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by