Click here to Skip to main content
13,097,926 members (57,551 online)
Rate this:
Please Sign up or sign in to vote.
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.

<Storyboard x:Key="slideUp">
           <DoubleAnimation Duration="0:0:0.5"
                            To="{Binding ElementName=MainWindow, Path=Height}" />
Posted 13-Jun-13 10:14am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 14 Jun 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100