Page 1 of 1

Mask on rectangle

Posted: 21 Apr 2021, 17:04
by BartekW
Hey, I want to make something like mask on rectangle: When button is out of rectangle isnt rendered, is like behind the background. Is here any idea?

Re: Mask on rectangle

Posted: 21 Apr 2021, 17:17
by sfernandez
You can set the property ClipToBounds to true in a parent container:
<Grid Width="200" Height="200" ClipToBounds="True">
  <Button Content="Button"/>
</Button>
Is this what you are looking for?

Re: Mask on rectangle

Posted: 21 Apr 2021, 17:25
by BartekW
You can set the property ClipToBounds to true in a parent container:
<Grid Width="200" Height="200" ClipToBounds="True">
  <Button Content="Button"/>
</Button>
Is this what you are looking for?
Yes, Thanks :)

Re: Mask on rectangle

Posted: 22 Apr 2021, 10:56
by sfernandez
Nice, I'm marking this as closed.