#1,054 – TabPanel Wraps and Evenly Spaces

Recall that a WrapPanel stacks controls horizontally until it fills the available space and then wraps to a new line.  (Or stacks vertically and wraps to a new column, if the orientation is vertical).


The TabPanel, normally used to display the tabs in a TabControl, behaves a little like the WrapPanel.  But when it decides to wrap to a new line, it evenly spaces the items within each line.

We can demonstrate this by starting with a wide window and then narrowing it to cause the items to wrap.




We can better visualize what’s going on here by changing the HorizontalAlignment of the Labels to Center so that they don’t stretch to fill the available space.  We can then see the gaps introduced between elements by the TabPanel.





Notice that the TabPanel also attempts to place roughly the same number of items on each row.


About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #1,054 – TabPanel Wraps and Evenly Spaces

  1. Pingback: Dew Drop – The Return – April 22, 2014 (#1760) | Morning Dew

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: