アプリのウインドウを​前面に持ってくるには​どうすればよいですか​?

App Designerでアプリ上にボタンを設置し、ボタンのコールバックでuigetfileを呼び出してmatファイルを読み込むと、uigetfileのダイアログの「開く」を押した時点で毎回アプリが他のウインドウの背面に隠れてしまいます。
アプリを最前面にしたままにする、もしくは背面に隠れてしまったアプリを最前面に戻す方法はありますか?

 Accepted Answer

Hernia Baby
Hernia Baby on 20 Dec 2022

0 votes

3 Comments

Yuichi Gomi
Yuichi Gomi on 20 Dec 2022
ご回答ありがとうございます。
上記の方法は試したのですが、
% app.UIFigure.WindowStyle = 'alwaysontop'; % R2018aなのでalwaysontopは未対応
app.UIFigure.WindowStyle = 'modal';
この機能は関数 uifigure で作成された Figure ではサポートされていません。詳細は、「App Designer でのグラフィックスのサポート」を参照してください。
というエラーが出てしまいます。
Hernia Baby
Hernia Baby on 20 Dec 2022
R2018aでのお話なのですね
コマンドの後に
drawnow;
figure(app.UIFigure)
を入れてみるのはどうでしょうか?
Yuichi Gomi
Yuichi Gomi on 20 Dec 2022
意図通り前面に戻ってくるようになりました。ありがとうございます!

Sign in to comment.

More Answers (0)

Categories

Find more on App Designer を使用したアプリ開発 in Help Center and File Exchange

Products

Release

R2018a

Community Treasure Hunt

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

Start Hunting!