Click here to Skip to main content
Rate this: bad
good
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"
                             Storyboard.TargetProperty="Height"
                             To="{Binding ElementName=MainWindow, Path=Height}" />
 </Storyboard>
Posted 13-Jun-13 11:14am

1 solution

Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 495
1 Maciej Los 340
2 Richard MacCutchan 265
3 BillWoodruff 225
4 Mathew Soji 200
0 OriginalGriff 8,804
1 Sergey Alexandrovich Kryukov 7,457
2 DamithSL 5,689
3 Maciej Los 5,279
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web02 | 2.8.1411028.1 | Last Updated 14 Jun 2013
Copyright © CodeProject, 1999-2014
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