Wrap Panel and Slider Control in WPF

Wrap Panel

The wrap panel is just like 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.

         <WrapPanel Orientation="Horizontal">
            <Button Content="B1" />
            <Button Content="B2" />
            <Button Content="Button" />
            <Button Content="Button" />
            <Button Content="Button" />
            <Button Content="Button" />
            <Button Content="Button" />
            <Button Content="Button" />
            <Button Content="Button" />
            <Button Content="Button" />
            <Button Content="Button" />
         </WrapPanel>

Wrappanel in wpf

Slider Control

WPF provides a special facility in the Slider Control. We can set the Minimum and Maximumproperty of the Slider. To allow only integer values we have to set the IsSnapToTickEnabled property to True.

       <
Slider Height="21" HorizontalAlignment="Left"
        Minimum="0" Maximum="20" 
        Margin
="10,10,0,0" Name="slider1" VerticalAlignment="Top"
        Width
="100" IsSnapToTickEnabled="True" Ticks="2" />

Ebook Download
View all
Learn
View all