Setting the GUI window always at center

10 次查看(过去 30 天)
Hi
I am trouble with setting my GUI window at the center of the computer screen whenever i click on the 'run' button to start the program. May I know is there a easy way to preset it in the OpeningFcn of the code?

采纳的回答

Sean de Wolski
Sean de Wolski 2013-3-28
doc movegui
And:
movegui(gcf,'center')
  5 个评论
JZH
JZH 2018-1-4
hey Sean, I got the following error, and it seems like movegui doesn't support GUI designed in app designer?
movegui(app.ELD_GUI, 'center') Error using matlab.ui.Figure/set Functionality not supported with figures created with the uifigure function. For more information, see Graphics Support in App Designer. Error in movegui (line 278) set(fig, 'OuterPosition', newpos);
Jessa Juarez
Jessa Juarez 2021-10-21
Hi @JZH, I used movegui(app.UIFigure, 'center') and it worked for app designer.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by