- First Create your application.
- Click on the app.UIFigure in the component browser and uncheck the “autoResizeChildren” Property.
- Add a “SizeChangdFcn” Callback for the UIFigure.
- Use the properties to control the minimum height and width using the below code.
Possibility that resizable-app-window has lower width- and height-limits dependent to the grid-layout inside of it?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nico
am 13 Sep. 2023
Kommentiert: Nico
am 9 Okt. 2023
Is there a possibility that resizable-app-window has lower width- and height-limits dependent to the grid-layout inside of it?
I would like to avoid that the window of my app is beeing resized to the extent that elements are no longer visible.
0 Kommentare
Akzeptierte Antwort
prabhat kumar sharma
am 26 Sep. 2023
Hi @Nico
I understand you are facing problem with the ability of resizing the app window of UIFigure beyond the certain limit ,and you want to set the minimum resizable limit for the window.
So I have tried the same on a application and I am able to find one solution for your usecase.
Find the below steps.
function UIFigureSizeChanged(app, event)
currentWidth = app.UIFigure.Position(3);
currentHeight = app.UIFigure.Position(4);
% Define the minimum width and height limits
minWidth = 500; % Set the minimum width limit
minHeight = 400; % Set the minimum height limit
% Adjust the window size if it goes below the minimum limits
if currentWidth < minWidth
app.UIFigure.Position(3) = minWidth;
end
if currentHeight < minHeight
app.UIFigure.Position(4) = minHeight;
end
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!