I want to know is there any box model is available in WPF controls same as we have in the box model of CSS. Wherein the total width of an element is equal to
the sum of its width, borders, margins and paddings.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaganathan BantheswaranPosted Jul 6, 2011, 1:36 AM
In WPF , Border and Control/Panel are separate elements. Border doesn't affect Control/Panel's width. If you need Border, you can create a separate Border element, and put your Control/Panel inside it. Margin means the space around a Control/Panel, so it also doesn't affect width. However, A Panel's children's margin does affect the parent Panel. Not all Controls have Padding. But Padding does affect that Control's width if exist. See http://msdn2.microsoft.com/en-us/library/ms751709.aspx for more information.