Working with WrapPanel

WrapPanel allows you to define content that will flow across the panel as the window is resized. When
positioning elements in a
WrapPanel, you do not specify Top, Bottom, Left, and Right docking values as
you typically do with the Canvas. However, each sub-element is free to define a Height and Width value,
among other property values, to control its overall size.

Because content within a WrapPanel does not ‘dock’ to a given side of the panel, the order in which you
declare the elements is critical. Content is rendered from the first element to the last. The WrapPanel will lay
out controls based on available space.


<WrapPanel Background = "LightSteelBlue">
<Label Name = "lblInstruction"
       Width = "328" Height = "27" FontSize = "15">
       Enter Car Information
</Label>
<Label Name = "lblMake">Make</Label>
<TextBox Name = "txtMake" Width = "193" Height = "25"/>
<Label Name = "lblColor">Color</Label>
<TextBox Name = "txtColor" Width = "193" Height = "25"/>
<Label Name = "lblPetName">Pet Name</Label>
<TextBox Name = "txtPetName" Width = "193" Height = "25"/>
<Button Name = "btnOK" Width = "80">OK</Button>
</WrapPanel>


Notice in the related screen shot how the elements wrap along the panel while the window changes size.
WrapPanel
Table of Contents
Copyright (c) 2008.  Intertech, Inc. All Rights Reserved.  This information is to be used exclusively as an
online learning aid.  Any attempts to copy, reproduce, or use for training is strictly prohibited.
Courseware
Training Resources
Tutorials
Services