Click here to Skip to main content
11,704,315 members (44,152 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Windows XAML WPF
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
0 Sergey Alexandrovich Kryukov 740
1 OriginalGriff 520
2 Maciej Los 355
3 Andy Lanng 284
4 CPallini 275
0 OriginalGriff 8,824
1 Sergey Alexandrovich Kryukov 8,247
2 CPallini 5,197
3 Maciej Los 4,726
4 Mika Wendelius 3,606

Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 14 Jun 2013
Copyright © CodeProject, 1999-2015
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