关闭网格内的剪辑 [英] Turn off Clipping inside Grid
本文介绍了关闭网格内的剪辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要知道如何在Grid的边界之外创建一个TextBlock渲染等元素。目前,如果元素变得足够大,它将被网格剪切。有没有办法为某些元素关闭此行为。 我有一个
一个动画,它通过使Text变大,然后再缩小,将注意力集中在Textblock上几秒钟。它包含的网格随着文本块的增长而剪切文本块。
I need to know how to make an element such as a TextBlock render outside the boundaries of a Grid. At the moment if the element grows large enough it will be clipped by the Grid. Is there a way to turn this behaviour off for certain elements. I have an Animation that brings attention to a Textblock for a few seconds by making it grow large and then shrink again. The Grid it is contained in clips the textblock as it grows.
谢谢。
<Grid Grid.Row="1" Grid.Column="1">
<Grid.RowDefinitions >
<RowDefinition Height="17" />
<RowDefinition Height="17" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="50" />
</Grid.ColumnDefinitions>
<Grid.Resources >
<Storyboard x:Name="Grow">
<DoubleAnimation Storyboard.TargetName="tbxScore" Storyboard.TargetProperty="FontSize" From="10" To="18" Duration="00:00:00.5" />
</Storyboard>
<Storyboard x:Name="Shrink">
<DoubleAnimation Storyboard.TargetName="tbxScore" Storyboard.TargetProperty="FontSize" From="18" To="10" Duration="00:00:00.5" />
</Storyboard>
</Grid.Resources>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Achieverscore" Margin="2" FontFamily="Arial" FontSize="10" VerticalAlignment="Center" FontWeight="Bold" HorizontalAlignment="Left" />
<TextBlock x:Name="tbxScore" Text="2500" Grid.Row="0" Grid.Column="1" Margin="2" FontFamily="Arial" FontSize="10" FontWeight="Bold" HorizontalAlignment="Right" VerticalAlignment="Center" />
<TextBlock Grid.Row="1" Grid.Column="0" Text="Weekly Participation" Margin="2" FontFamily="Arial" FontSize="10" VerticalAlignment="Center" FontWeight="Bold" HorizontalAlignment="Left" />
<TextBlock Grid.Row="1" Grid.Column="1" x:Name="tbxPartWeekSeconds" Text="" Margin="2" FontFamily="Arial" FontSize="10" VerticalAlignment="Center" FontWeight="Bold" HorizontalAlignment="Right" />
</Grid>
Eric
Eric
推荐答案
将TextBlock放入Canvas中网格内的画布。
Put the TextBlock inside a Canvas and that Canvas inside your Grid.
这篇关于关闭网格内的剪辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文