Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to Create a NON-RESIZABLE GUI that displays properly on all screen resolutions?

Subject: How to Create a NON-RESIZABLE GUI that displays properly on all screen resolutions?

From: Stefanie

Date: 11 Feb, 2012 22:46:10

Message: 1 of 5

I am trying to create a GUI using GUIDE that is NON-RESIZABLE but displays properly in all screen resolutions. I have currently built it using GUIDE with a screen resolution of 1920x1200 with font size of "small". When I open it up on a 1920X1200 font size "medium" parts of the GUI are cut off (this also obviously occurs if I have a lower resolution as well). I have created and saved the GUI in 'characters' units, as I thought this is what would allow for a resolution-independent GUI, but this does not appear to be working. When I change the units to 'normalized', this helps, provided I can then resize the GUI once opened, which I DO NOT want to give the user the ability to do. How can I turn my GUIDE created GUI into a NON-RESIZABLE GUI that will display properly on different screen resolutions?

Subject: How to Create a NON-RESIZABLE GUI that displays properly on all screen resolutions?

From: Admin

Date: 12 Feb, 2012 07:13:22

Message: 2 of 5

modify "GUI Opitions" --> Resize behavior --> Other (Use ResizeFcn)

Then edit "View Callbacks" --> ResizeFcn
add the following codes to line " function figure1_ResizeFcn(hObject, eventdata, handles) "

rect = get(0, 'ScreenSize');
set(hObject, 'Position', rect);

Subject: How to Create a NON-RESIZABLE GUI that displays properly on all screen resolutions?

From: Stefanie

Date: 13 Feb, 2012 14:28:59

Message: 3 of 5

"Admin" wrote in message <jh7oqi$jpl$1@newscl01ah.mathworks.com>...
> modify "GUI Opitions" --> Resize behavior --> Other (Use ResizeFcn)
>
> Then edit "View Callbacks" --> ResizeFcn
> add the following codes to line " function figure1_ResizeFcn(hObject, eventdata, handles) "
>
> rect = get(0, 'ScreenSize');
> set(hObject, 'Position', rect);


Thank you for your reply.
I don't think this will completely solve my problem. I know that this will still allow my GUI to be resizable, which I don't want. Is there a way then to lock that size once it adjusts so the user cannot adjust the size of the window?

Thank you!

Subject: How to Create a NON-RESIZABLE GUI that displays properly on all screen resolutions?

From: Steven_Lord

Date: 13 Feb, 2012 15:04:53

Message: 4 of 5



"Stefanie " <stefanie.marotta@gmail.com> wrote in message
news:jhb6nb$7sj$1@newscl01ah.mathworks.com...
> "Admin" wrote in message <jh7oqi$jpl$1@newscl01ah.mathworks.com>...
>> modify "GUI Opitions" --> Resize behavior --> Other (Use ResizeFcn)
>>
>> Then edit "View Callbacks" --> ResizeFcn add the following codes to line
>> " function figure1_ResizeFcn(hObject, eventdata, handles) "
>>
>> rect = get(0, 'ScreenSize');
>> set(hObject, 'Position', rect);
>
>
> Thank you for your reply.
> I don't think this will completely solve my problem. I know that this
> will still allow my GUI to be resizable, which I don't want. Is there a
> way then to lock that size once it adjusts so the user cannot adjust the
> size of the window?

Set the figure's Resize property to 'off'.

http://www.mathworks.com/help/techdoc/ref/figure_props.html#Resize

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: How to Create a NON-RESIZABLE GUI that displays properly on all screen resolutions?

From: Michael

Date: 7 Aug, 2012 15:29:24

Message: 5 of 5

The code will enlarge the window over two screeens, if you have two screens connected to your computer!

CU
Mike

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us