WrapPanel and DockPanel two are relatively simple layout containers. These two controls will compensate for some of the deficiencies of StackPanel
WrapPanel Controls:
The control's Orientation property, where controls are placed vertically in a stacked control or row, WrapPanel
Similar to StackPanel. In addition to stacking, WrapPanel contains controls that provide line-wrapping support. If the
When the WrapPanel control provides more content than the container, it wraps itself.
DockPanel Controls:
The DockPanel provides docking support. So that other controls can be docked on the side of the panel easily positioned.
WrapPanel
<Grid> <wrappanel margin= " 3 " > <button verticalalignment=" top > top-level button </Button> <button M Inheight= " 60 " > Higher button </Button> <button verticalalignment=" bottom " > Bottom button </ button> <Button> Stretch button </Button> <button verticalalignment=" center " > Middle button </button > </WrapPanel> </grid>
:
DockPanel
<Grid> <!--The Note:lastchildfill property is set to True, which is the default setting, and the child element always fills the remaining space regardless of any other docking value for the last element of DockPanel. To speak child elements docked in another In one Direction, the LastChildFill property must be set to FALSE, and the last child element must also be set to display the docking direction. -<!--<dockpanel lastchildfill="True">--> <dockpanel lastchildfill="False"> <button dockpanel.dock="Top"> Top docking </Button> <button dockpanel.dock="Bottom"> Bottom docking </Button> <button dockpanel.dock=" Left"> Left dock </Button> <button dockpanel.dock=" Right"> Right docking </Button> <!--<Button> remaining space </Button>--> <button dockpanel.dock="Top"> Remaining space </Button> </DockPanel> </Grid>
WrapPanel and DockPanel