control z-order without z-index?
-
Hey I have the following Scenario:
<StackPanel Width="200" Height="100" Background="Yellow" Name="BigPanel">
<Canvas Width="80" Height="80" Background="Blue" Margin="10" Name="RectanglePanel" >
<Rectangle Canvas.Left="10" Canvas.Top="1" Height="50" Width="50" Fill="Black" Name="MyRectangle">
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Rectangle.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="MyRectangle"
Storyboard.TargetProperty="(Canvas.Left)"
From="10" To="-30" Duration="0:0:5"
RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard></EventTrigger>
</Rectangle.Triggers>
</Rectangle>
</Canvas>
</StackPanel>The Problem is when the rectangle left the Rectanglepanel that contains him (for example in the ContainerPanel) it is still visible, how can i make the rectangle be visible only in its parentpanel=rectanglepanel? is there a property or a way for that?
-
Hey I have the following Scenario:
<StackPanel Width="200" Height="100" Background="Yellow" Name="BigPanel">
<Canvas Width="80" Height="80" Background="Blue" Margin="10" Name="RectanglePanel" >
<Rectangle Canvas.Left="10" Canvas.Top="1" Height="50" Width="50" Fill="Black" Name="MyRectangle">
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Rectangle.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="MyRectangle"
Storyboard.TargetProperty="(Canvas.Left)"
From="10" To="-30" Duration="0:0:5"
RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard></EventTrigger>
</Rectangle.Triggers>
</Rectangle>
</Canvas>
</StackPanel>The Problem is when the rectangle left the Rectanglepanel that contains him (for example in the ContainerPanel) it is still visible, how can i make the rectangle be visible only in its parentpanel=rectanglepanel? is there a property or a way for that?
Defender-NF wrote:
is there a property or a way for that?
Yep. ClipToBounds = "True"[^] on the canvas should do the trick.
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels) -
Defender-NF wrote:
is there a property or a way for that?
Yep. ClipToBounds = "True"[^] on the canvas should do the trick.
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)thanks a lot.