WPF Web Based

WPF Examples

WPF

WPF Projects

WPF Project

adplus-dvertising
WrapPanel Control in WPF Web Base
Previous Home Next

Wrap panel wraps all child elements to new lines if no space is left. The wrap panel is similar to the StackPanel but it does not just stack all child elements to one row, it wraps them to new lines if no space is left. The Orientation can be set to Horizontal or Vertical.

The WrapPanel can be used to arrange tabs of a tab control, menu items in a toolbar or items in an Windows Explorer like list. The WrapPanel is often used with items of the same size, but its not a requirement.

Example:

.XAML.CS CODE

<Page x:Class="WpfBrowserApplication5.Page14"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Page14">
    <Grid x:Name="LayoutRoot" Background="White" >
    <WrapPanel Orientation="Vertical">
     <Image Source="_homebanner_1.gif" Width="97.135" Height="28"  />
     <Ellipse Width="80" Height="80" Fill="Orange" />
     <Image Source="main_flash.jpg" Width="69.999" Height="26"  />
     <Ellipse Width="40" Height="40" Fill="Green" />
     <Ellipse Width="20" Height="20" Fill="Blue" />
     <Rectangle Width="100"  Height="100" Fill="Cyan" Cursor="None" 
FlowDirection="RightToLeft"></Rectangle>
     <Rectangle Width="80" Height="80" Fill="DarkGoldenrod"></Rectangle>
     <Rectangle Width="60" Height="60" Fill="Chartreuse"></Rectangle>
     <Rectangle Width="40" Height="40" Fill="Coral"></Rectangle>
     <Rectangle Width="20" Height="20" Fill="DarkGoldenrod"></Rectangle>
    </WrapPanel>
     </Grid>
</Page>
Previous Home Next
WPF Examples

WPF

WPF

WPF

WPF

WPF

WPF

WPF

WPF