Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. control z-order without z-index?

control z-order without z-index?

Scheduled Pinned Locked Moved .NET (Core and Framework)
questiondatabasehelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Defender NF
    wrote on last edited by
    #1

    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?

    I 1 Reply Last reply
    0
    • D Defender NF

      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?

      I Offline
      I Offline
      Ian Shlasko
      wrote on last edited by
      #2

      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)

      D 1 Reply Last reply
      0
      • I Ian Shlasko

        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)

        D Offline
        D Offline
        Defender NF
        wrote on last edited by
        #3

        thanks a lot.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups