6

I don't want to display content that is outside the border in my wpf application. Here is an image to illustrate better my point:

enter image description here

in that picture the blue box is the border and note that its child is a listview. I don't want to display the entire listview. I just want to display whatever is inside the blue border.

What control do I have to use in order to achive that? I am looking for some sort of a mask... Is creating a custom user control my only option?

Tono Nam
  • 34,064
  • 78
  • 298
  • 470
  • 1
    not really clear what you want to achieve, sorry. Do you want that `ListView` is **always** inside `border`? – Tigran Mar 05 '12 at 20:43

2 Answers2

14
<Border ClipToBounds="True">
    <ListView .../>
</Border>
Kent Boogaart
  • 175,602
  • 35
  • 392
  • 393
5

Just set ClipToBounds to true on the border and it should be cut off.

H.B.
  • 166,899
  • 29
  • 327
  • 400