Reputation: 73
I really need help for this questions, I search everywhere but can't seem to find an answer. I have a window with the height set to 66. In my code behind I have a button on the bottom of the the window. when the user clicks this button(this.height = 400), the size of the window is to grow from bottom up. but it grows from left top corner. please help :(
Upvotes: 3
Views: 1106
Reputation: 73
Thank you everyone for your answers. I finally solved this issue by using a popup. I attached it to the top of the window and when its height is increased, it increases from bottom up.
Popup Text
Upvotes: 0
Reputation: 2149
Your description sounds to me as if you want to decrease the Top
property value of your WPF Window by the same value that you increase its Height
, or rather its ActualHeight
effectively.
There is also an Expander
control in WPF that you might find useful.
Upvotes: 0
Reputation: 105
I think you need to change how the controls are anchored in the window. They are going to default to anchoring to the top left, so when the window size changes, the controls will not move. If you anchor the a control to the bottom, then when the window grows, the control will move down accordingly.
Upvotes: 1