uigetfile error in MATLAB

1 回表示 (過去 30 日間)
ali hassan
ali hassan 2022 年 1 月 28 日
編集済み: TED MOSBY 2025 年 8 月 20 日
i am using uigetfile to select a file in my DESIGNAPP.
once the file is selected, the app minimizes.
i dont want it to happen. plz guide
  1 件のコメント
Geoff Hayes
Geoff Hayes 2022 年 1 月 28 日
@ali hassan - can you show us the code that calls uigetfile? What OS are you using? Please provide more details.

サインインしてコメントする。

回答 (1 件)

TED MOSBY
TED MOSBY 2025 年 8 月 20 日
編集済み: TED MOSBY 2025 年 8 月 20 日
Hi,
The best fix is to upgrade to MATLAB R2025a as this issue has been fixed starting this release.
Refer to this MATLAB answer:
Some workarounds for releases before R2025a:
1.You can keep the app window foregrounded by setting the UI figure’s WindowStyle:
% In startupFcn or after creating the UIFigure:
app.UIFigure.WindowStyle = 'alwaysontop';
This property exists for uifigure starting in R2021a. Note that it pins your app above other windows.
2. Create a hidden dummy figure before uigetfile and delete it right after. This prevents your app from minimizing or falling behind other windows.
f = figure('Visible','off','CloseRequestFcn',''); % dummy owner
[fn, fp] = uigetfile({'*.*','All files'}, 'Select a file');
delete(f);
Hope this helps!

カテゴリ

Help Center および File ExchangeDevelop uifigure-Based Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by