uigetdir: bring to front

103 views (last 30 days)
George A.
George A. on 2 Apr 2017
Edited: Anton Semechko on 18 Feb 2021
I have created an app with appdesigner and added the uigetdir function in a button. When the button is pressed the uigetdir opens the "choose folder window" in the background, i.e., the app figure is in front of uigetdir window.
How can I bring the uigetdir window to the foreground?
Thank you for your help.
Jan on 1 Jul 2018
@Rene Mayer: Please post some code, which reproduces the problem and mention your Matlab version.

Sign in to comment.

Answers (1)

Daniel Benalcazar
Daniel Benalcazar on 12 Nov 2019
I had the same problem, but I found online a trick to fix it. Just after calling uigetdir, set the visibility of your app on:
path = uigetdir;
app.UIFigure.Visible = 'on';
  1 Comment
Anton Semechko
Anton Semechko on 18 Feb 2021
Edited: Anton Semechko on 18 Feb 2021
In Matlab R2020a this works only if you set app.UIFigure.Visible='off' before calling uigetdir and then set it to app.UIFigure.Visible='on' afterwards.
Another solution is described here: https://www.mathworks.com/matlabcentral/answers/296305-appdesigner-window-ends-up-in-background-after-uigetfile

Sign in to comment.


Find more on Develop uifigure-Based Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!