Non Maximized matlab GUI figure

不羁岁月 提交于 2019-12-12 16:25:02

问题


Is there a way to create a GUI which starts as a maximized windows? I've tried to add set(gcf,'Units','normalized','Position',[0,0,1,1]); at the end of my gui's mygui_OpeningFcn() function but the GUI is not maximized properly (see printscreen).

Setting the GUI properties at GUIDE to Units-'normalized' and Position-[0,0,1,1] didn't help either.

I've also tried to use the Matlab File Exchange maximize function by adding maximize(handle.figure1); at the end of my gui's mygui_OpeningFcn() but it doesn't work either (same visual result - a GUI which is not entirely maximized).

Is there a way to make the Matlab GUI appear as a maximized figure when I launch it? Why am I getting this strange visual behavior of the GUI?


回答1:


If you are on a Windows machine, I suggest you use the WindowAPI submission from FEX. It directly calls Windows API functions (using a MEX file), thus allowing far more advanced control of figures than just minimize and maximize:

hFig = figure('Menubar','none');
WindowAPI(hFig,'Maximize')


来源:https://stackoverflow.com/questions/10798095/non-maximized-matlab-gui-figure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!