Harald Maassen
Harald Maassen

Reputation: 81

Silverlight: How do I create a scrollable horizontal list of images

Most answers to this question say to do something like this:

<ListBox Margin="47,241,53,264">

    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel Orientation="Horizontal" />
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>

    <Image Height="100" Width="100" Source="/ApplicationIcon.png"/>
    <Image Height="100" Width="100" Source="/ApplicationIcon.png"/>
    <Image Height="100" Width="100" Source="/ApplicationIcon.png"/>
    <Image Height="100" Width="100" Source="/ApplicationIcon.png"/>
    <Image Height="100" Width="100" Source="/ApplicationIcon.png"/>
</ListBox>

However this will not enable horizontal scrolling.

Upvotes: 1

Views: 761

Answers (1)

mcabral
mcabral

Reputation: 3558

You are not setting the Visibility to the Scrollbar

<ListBox Margin="47,241,53,264"
    ScrollViewer.VerticalScrollBarVisibility="Visible">
    .
    .
    .
</ListBox>

should do the trick.

Upvotes: 4

Related Questions