ClipToBounds property of WPF

When I was working on a control today, I encountered a situation where it was displayed beyond the scope of the control. No matter how you set the ClipToBounds property of the Grid, the part outside the scope will be clipped. Searching for solutions on the Internet, I have the following answers:

"When you set ClipToBounds to True, the excess will be clipped; but when you set ClipToBounds to False, the excess will not necessarily be cropped."

But it's still not clear why. Finally switched to Canvas instead of Grid.

Guess you like

Origin blog.csdn.net/qq_41617901/article/details/110945661