Hi,
Im using a stackpanel containing itemcontrols and displaying some canvas'.
How do i make a scrollbar on the stackpanel so that i can see all the canvas' that I am using?
Thanks in advance.
Urema.
Answers (2)
0
Sanjay,
Thanks for the reply it helped significantly!!
Urema.
0
Hi,
<StackPanel Grid.Row="1" Grid.Column="1" Background="RoyalBlue" Height="400" ScrollViewer.VerticalScrollBarVisibility="Auto">
<ItemsControl x:Name="lstPics" ItemsSource="{Binding}" Height="400" SelectionChanged="lstPics_SelectionChanged" ScrollViewer.VerticalScrollBarVisibility="Visible">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Path=FileName}" />
<CheckBox IsChecked="{Binding Path=IsSavedInServer}" Content="exist in server" />
</StackPanel>
<Image Source="{Binding Path=ImageSource}" Height="100" Width="150" Stretch="Fill" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl >
</StackPanel>
Put the
ScrollViewer.VerticalScrollBarVisibility="Auto"
For vertical scrollbar. Check the above code.