Represents a container that supports absolute positioning of child controls and enables scrolling.
public class ScrollBox : LayoutControlBase
Public Class ScrollBox Inherits LayoutControlBase
The ScrollBox container takes into account the size and position of its child controls when calculating its client size. So, if the container's size is not explicitly limited (for instance, via its Width and Height properties), its size will be calculated to fit all its children.
If the container's size is limited and a child control or part of the control is positioned outside the visual bounds of the ScrollBox, scroll bars appear, enabling scrolling.
The ScrollBox's LayoutControlBase.Padding inherited property affects the offset of the client area where child controls reside. Therefore, this property affects the offsets of the child controls from the ScrollBox's left and top edges.
<lc:ScrollBox x:Name="myScrollBox" Background="#FF91B6B9" > <Button Content="Button 1" Height="50" Width="100" Margin="10,0,0,0"/> <Button Content="Button 2" Height="50" Width="100" lc:ScrollBox.Left="120"/> </lc:ScrollBox>