Question: How to Maximize, Minimize, Restore WinUI window from code?
See original GitHub issueIs there an API that manipulates a WinUI window size/state from code?
I have used the TitleBar API’s that I am aware of to set a custom TitleBar
ExtendsContentIntoTitleBar = true;
SetTitleBar(myControl);
While this works to set the TitleBar, the Minimize/Maximize/Close buttons are now unresponsive. I would like to overlay my own buttons to restore the broken behavior. Or, if there is a better example for how to set the custom TitleBar that does not disable the main window buttons, that would be a great solution as well. I posted this on StackOverflow, but have not had any responses.
This is for WinUI 3 (Project Reunion 0.5), Win32 Desktop
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
c# - How to Maximize, Minimize, Restore WinUI window ...
I'm creating a demo app using WinUI 3 prerelease 0.5 (project reunion). I would like to maximize, minimize, and restore the window state...
Read more >How to Maximize, Minimize, Restore WinUI window from code-C
Here is my implementation based on the PInvoke.User32 nuget package. Version using Window parameter public void MaximizeWindow(Window window) { var ...
Read more >Full-screen, disable minimize/maximize for .NET MAUI ...
In this post we will learn how to make your .NET MAUI Windows app fullscreen or disable the maximize and minimize button on...
Read more >ShowWindow function (winuser.h) - Win32 apps
Activates and displays a window. If the window is minimized, maximized, or arranged, the system restores it to its original size and position....
Read more >WinUI 3 for Desktop: minimize the App : r/dotnet
Is there already a native command to minimize the app without using ... need some code to get your AppWindow from the current...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@omnilogix The custom Title bar has a couple of bugs that depending on the XAML layout caption buttons aren’t rendered on the top of the visual tree. We have bug fixes ready for 0.8 GA.
About Maximize, Minimize, and Restore WinUI window from code, you can find some samples at DesktopWindow that shows you how you can achieve it using Win32 APIs. These window functionalities will be added post v1, per the current engineering plan.
Thanks omnilogix for bringing this up, really sorry you didn’t get a timely response!
Ping @MikeHillberg, question for you above.