フィルターのクリア

Is there any way to get the uigetfile panel to be centered in the monitor when it first comes up????

12 ビュー (過去 30 日間)
I use the MATLAB function uigetfile to read in the path and name of a file. How do I get that panel to appear in the center of the screen. It always pops up in the upper left corner of the screen.
Note, this code must work with the compiler also.
Thanks Bob
  8 件のコメント
Walter Roberson
Walter Roberson 2022 年 3 月 17 日
Having the functionality work sometime is better than not having it work at all.
However, as you are working with Windows, do not be astonished if it suddenly stops working with some KB*, or if it works differently depending which Creators Edition or half-year Windows update, or whatever.
Matt J
Matt J 2022 年 3 月 17 日
編集済み: Matt J 2022 年 3 月 17 日
So for now, "Operating-System Dependent Behavior" is best for me. It works.
I'm on a Windows 10 OS and, as I said, the method doesn't work on my machine. I think you will see that if you manually drag the uigetfile window to some random location on the screen and then re-run your code. In Windows, the uigetfile windows will always open where it was last positioned.

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

回答 (2 件)

Walter Roberson
Walter Roberson 2022 年 3 月 15 日
No, there is no control over that.
If you are not using a deployed app, then MATLAB runs a java method to start an operating-system native file picker. There are no user-level controls over where that operating-system facility will appear.

Matt J
Matt J 2022 年 3 月 15 日
If you drag the uigetfile window to the location where you want it then, the next time you call uigetfile, it will open in that position, even if it's in a later Matlab session. I don't know if something similar would hold true for a deployed app.

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by