Resize the main WPF window dynamically
https://www.systanddeploy.com/2018/07/resize-main-wpf-window-dynamically.html
In this post I will explain you how to resize dynamically the size of your main WPF GUI.
It's a very easy trick that can be very useful, and can be done in three steps:
1 / Add few parameters in your XAML
2 / Change the visibility of controls from the PS1
3 / Add some conditions or actions
When can it be useful ?
- You have a GUI as below.
Main GUI |
- You configured the Visibility attribute with the collapsed value.
- After clicking on the Hide button, the GroupBox will be hidden as below.
Hide with no dynamic resize |
Blank space |
How to proceed ?
2 / In the Window part, add the below lines:
3 / Open your PS1
4 / Add the below lines in the Hide button action part:
And now here we are, let's try again.
- Open the GUI
- The GroupBox is displayed
- Click on the Hide button
- And voila, the GroupBox is hidden and the GUI height has changed
2 commentaires
could have been a great article, but it is missing a lot of explanation...dunno if u did it on purpose...would have been great for instance to let your code on github. or on the same page.
Awesome blog youu have here
Enregistrer un commentaire