Uigetfile will make app be behind another windows.
Mostrar comentarios más antiguos
I use APP Designer to make a App figure. I want to load my file and display its name,so I use uigetfile. But used uigetfile will make my figure be behind another windows, I have to click it in Taskbar again. Why is this so?
Respuesta aceptada
Más respuestas (6)
Melaku Eneayehu
el 20 de Feb. de 2018
3 votos
add the following two lines of code just after uigetfile() app.UIFigure.Visible = 'off'; app.UIFigure.Visible = 'on';
don't forgot to edit figure per-fix if you don't use the default one
Riyadh Abbas
el 26 de Mayo de 2017
0 votos
Hi there, I found a solution to this issue provided by http://undocumentedmatlab.com/blog/solving-a-matlab-hang-problem, which suggested adding two lines drawnow; pause(0.05);
I tried it and it did work for me, hope can solve your problem.
2 comentarios
Petar Lambrev
el 12 de Jun. de 2017
drawnow; pause(0.05); Does not work for me. After closing get file window, the main app window is in the background.
Chris McRaven
el 16 de Jun. de 2017
Matthew Thomas
el 18 de Nov. de 2019
0 votos
This is a duplicate of https://uk.mathworks.com/matlabcentral/answers/296305-appdesigner-window-ends-up-in-background-after-uigetfile , you might find some answers there.
It does seem to be unintended behaviour though, it is frustrating to need to work around this.
Onur Ozdemir
el 14 de Mzo. de 2022
0 votos
All given answers address getting the app window back as focus after uigetfile but what is preferred is to prevent it from minimizing in the first place. You can check out my answer to this question here, which is the same question.
Jorg Woehl
el 14 de Mayo de 2024
0 votos
I have just published a simple workaround for these focus issues, which -- as The MathWorks acknowledges -- still have "currently no official workaround". Check out my File Exchange contribution https://www.mathworks.com/matlabcentral/fileexchange/165961-fixfocus.
Adam Danz
el 11 de Jul. de 2025
0 votos
Thanks for reporting the problem.
This has been fixed in R2025a. Focus now returns to the app that called uigetfile after the dialog is closed. The fix is also available in the R2024a and R2024b beta releases only (not the R2024a and R2024b general releases).
Categorías
Más información sobre App Building en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!