Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit setting the height of the Layout.Children dynamically
2 replies. Latest Post by ramya.mt on January 9, 2009.
(0)
ramya.mt
Member
9 points
28 Posts
01-09-2009 1:16 AM |
Hi,
How can I set the height of the Layout.Children element dynamically?
Thanks
neal.gab...
Participant
789 points
161 Posts
01-09-2009 1:47 AM |
Do you want to change the height of all the Children in the Grid, or for one child ?
If it is for one child, you can access with the name of the CHild
Say for eg:
<Grid x:Name = "LayoutRoot">
<TextBlock x:Name="txtTest"/>
You can a set height of the TextBlock in code behind as follows:
txtText.Height = 12;
else if you have n children for grid access it thru a for each loop
eg:
{
oTextBlock.FontWeight =
oTextBlock.Height= 10;
}
This is the case when there is a border inside the Grid;
Use this logic and change accordingly
01-09-2009 2:18 AM |
Thanks a lot!!!