#398 – WrapPanel Element

The WrapPanel element serves as a container for a collection of child elements, positioning its children in one of two ways:

  • In a horizontal orientation (the default).  Child elements are added left to right, until a row fills up, and then wrapped to the next row
  • In a vertical orientation.  Child elements are added top to bottom, until a column fills up, and then wrapped to the next column
    <WrapPanel Orientation="Horizontal">
        <Label Background="AliceBlue" Content="William I" />
        <Label Background="AntiqueWhite" Content="William II"/>
        <!-- etc -->
    </WrapPanel>

    <WrapPanel Orientation="Vertical">
        <Label Background="AliceBlue" Content="William I" />
        <Label Background="AntiqueWhite" Content="William II"/>
        <!-- etc -->
    </WrapPanel>

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

4 Responses to #398 – WrapPanel Element

  1. Pingback: Dew Drop – September 30, 2011 | Alvin Ashcraft's Morning Dew

  2. Pingback: #399 – WrapPanel Will Change Layout of its Children as its Size Changes « 2,000 Things You Should Know About WPF

  3. Brack Bhuvan says:

    Really this is good one. Only to the point nothing else. You made it very simple and understandable which make more user friendly. Some good articles too, I’ve found during searching time over internet which also explained very well about WrapPanel in WPF. Those post URL:
    http://www.c-sharpcorner.com/uploadfile/mahesh/wrappanel-in-wpf/
    and
    http://mindstick.com/Articles/30a24196-28c4-437e-87bc-4c481555bacc/?WrapPanel%20in%20WPF

  4. Pingback: #887 – The Difference between Disabled and Hidden Scrollbar Visibility | 2,000 Things You Should Know About WPF

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: