Click here to Skip to main content
15,886,761 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So, I'm trying to create a storyboard that will adjust the size of the grid until it is the same height as the client area of the current window. Yet, with what I have now, the text in my grid keeps running of the screen, and my only conclusion is that it is adjusting to the height of the full window, border and all. I tried "ActualHeight" but that didn't work either. Any ideas? Thanks in advance.

HTML
<Storyboard x:Key="slideUp">
           <DoubleAnimation Duration="0:0:0.5"
                            Storyboard.TargetProperty="Height"
                            To="{Binding ElementName=MainWindow, Path=Height}" />
</Storyboard>
Posted

1 solution

if the grid is inside window, you should not do such tricks to stretch it. Just set HorizontalAlignment and VerticalAlignment to Stretch and it will occupy all client area. You can check it by setting grid background to some color. If it looks like text is out of the window, perhaps there is something wrong with your layout. Maybe you need somwthing like WrapPanel, or just to set TextWrapping.
It would be better if you post here the xaml of your window and screenshot. It will allow people to help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900