フィルターのクリア

App designer uifigure position

26 ビュー (過去 30 日間)
moin khan
moin khan 2021 年 7 月 13 日
コメント済み: Asavon Asavon 2023 年 7 月 10 日
I am using MATLAB R2021a. I just created a MATLAB app using app designer. I want to set app window position to be centered when it being executed. In fiqure customiztion position is in coordinates [x y width height] i guess type. I also try center position in startup function but that function centre window after components creation i.e first it create old position and then chnage to centre. I want to make window/fiqure to be centered while it open before components creation as it open in usually so it only display at centre of screen display

回答 (1 件)

Kanishk Singhal
Kanishk Singhal 2023 年 7 月 10 日
You can get the current screen size and then position the window accordingly,
screenSize = get(0,'ScreenSize');
centerX = screenSize(3)/2;
centerY = screenSize(4)/2;
appOptions.WindowBounds = [centerX-650 centerY-400 1300 800];
% 1300/2 = 650, 800/2 = 400
  1 件のコメント
Asavon Asavon
Asavon Asavon 2023 年 7 月 10 日
I appreciate your suggestion very lot. I appreciate your support. octordle

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

カテゴリ

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