Proposal: Adding Min / Max Window Size.
Proposal: [Max / Min Window Size]
Adding minimum / maximum window size.
Summary
Method to add a minimum / maximum window size.
Rationale
-
Saves time because you don't have to develop your own functions for setting the minimization and maximization of the window.
-
Reduces the complexity of the project as the function is already in existence.
-
Very many software engineers are waiting for this feature, so time can be saved.
Scope
| Capability | Priority |
|---|---|
| This proposal will allow developers to accomplish W | Must |
| This proposal will allow end users to accomplish X | Should |
| This proposal will allow developers to accomplish Y | Could |
| This proposal will allow end users to accomplish Z | Won't |
Important Notes
Open Questions
Saves time because you don't have to develop your own functions for setting the minimization and maximization of the window.
Just handle WM_GETMINMAXINFO
I know this works, but it would be better if there was a better feature.
Saves time because you don't have to develop your own functions for setting the minimization and maximization of the window.
Just handle WM_GETMINMAXINFO
Saves time because you don't have to develop your own functions for setting the minimization and maximization of the window.
Just handle WM_GETMINMAXINFO
If this was the only problem in WinUI, then yes we could live with such a workaround. But this is just yet another issue where you need custom handling. As Avaidn hints at, this should be simple. Such that all developers from now does not have to make workarounds.
I agree this feature would be useful. Until that is available, here are some pointers which may help developers looking for a workaround:
- #2945
- A helper Window subclass which adds useful functionality including Min/Max size: DesktopWindow
Upvoting!
Can't belive this is still a thing in 2025, how does microsoft think that such a simple aspect of a window needs so many hoops, how they expect developers would choose WinUI3 when is so cumbersome to do stuff
Can't belive this is still a thing in 2025, how does microsoft think that such a simple aspect of a window needs so many hoops, how they expect developers would choose WinUI3 when is so cumbersome to do stuff
In v1.7 you can access this api
https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/stable-channel#new-appwindow-apis
PreferredMinimumWidth/Height
PreferredMaximumWidth/Height
And this issue can be closed @RDMacLachlan
Can't belive this is still a thing in 2025, how does microsoft think that such a simple aspect of a window needs so many hoops, how they expect developers would choose WinUI3 when is so cumbersome to do stuff
In v1.7 you can access this api
https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/stable-channel#new-appwindow-apis
PreferredMinimumWidth/Height PreferredMaximumWidth/HeightAnd this issue can be closed @RDMacLachlan
Now It seems that we can use
if(AppWindow.Presenter is OverlappedPresenter presenter) { presenter.PreferredMinimumWidth = 800; presenter.PreferredMinimumHeight = 600; }
in MainWindow set minimumsize. :)