How to keep the original layout in the full screen or when maximizing the GUI of a MATLAB App ?
33 views (last 30 days)
Show older comments
Hello everyone,
I am desinging an App in the MATLAB App Designer, I am using MATLAB R2023a, and I am working on a Windows operating system.
After finishing the design of my App, I have noticed that when running the App, the layout of the designed GUI is lost when the GUI is on full screen or when it is maximized. Please see the attached Capture1 and Capture2 for the layouts of the GUI (Capture1 shows the layout when the GUI is minimised, this is the original layout that I have designed, and Capture2 shows how the layout is changed when the GUI is on full screen or when it is maximized).
I want that the GUI keeps the original layout that I have set when I was designing the App in the App designer, when the GUI is on full screen or when it is maximized.
I have found on some answers of MATLAB Central that I Should select for WindowState "fullscreen" or "maximized" and that I should also select "Resize" and "AutoResizeChildren" in the Settings of POSITION. I have done all that, please see the attached Capture3, but I still have the same problem.
Does anyone have any solution for this problem ?
Many thanks to everyone in advance.
0 Comments
Accepted Answer
Rik
on 15 Jun 2024
You should set the units to Normalized. That will scale the sizes of the buttons as you expect.
There is an art to this, since you might want your GUI to look good on VGA, as well as 4k.
You could consider using the ResizeFcn property to scale the font size as well.
5 Comments
Rik
on 19 Jun 2024
You need to set the Units property to 'Normalized'. Normally something this should do it:
app.object.Units='Normalized';
Although I admit I have never tested this in an AppDesigner app.
More Answers (0)
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!