Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can a control draw outside its bounding box?

Here's an example image of what I mean: example

The gray rectangle is the bounding box of a control that draws the blue lines and dots in it's OnRender(...) method. The red ovals mark places where it happens.

  • Why is that possible?
  • How can it be avoided?
like image 534
Mario Gu Avatar asked Sep 15 '10 22:09

Mario Gu


1 Answers

Here's the perfect answer to my second question, at least when using a rectangular shaped control:

<object ClipToBounds="True" />

More details on the MSDN.

like image 91
Mario Gu Avatar answered Sep 22 '22 13:09

Mario Gu