2011-11-23 21 views
1

大多數回答這個問題的滾動水平列表說做這樣的事情:的Silverlight:如何創建圖像

<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> 

但是這不會使橫向滾動。

回答

4

你沒有瀏覽權限設定改爲滾動條

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

應該做的伎倆。

+0

謝謝!我需要將ScrollViewer.Horizo​​ntalScrollBarVisibility設置爲「可見」而不是垂直的,但除此之外,這個技巧很好。拋開我的是,如果沒有明確地設置這個列表框的水平滾動類型,有時候,如果你足夠努力:/ –