1、自定义ListBoxItem
<GrID x:name="LayoutRoot" Background="transparent">
<ScrollVIEwer VerticalScrollbarVisibility="auto" HorizontalScrollbarVisibility="auto">
<border Style="{StaticResource Commonborder}">
<ListBox x:name="MyListBoxToShowProperty" margin="10">
<ListBox.ItemTemplate >
<DataTemplate>
<StackPanel OrIEntation="Horizontal">
<TextBlock Text="{Binding zhIDuan}" margin="5,2,0"/>
<TextBlock Text="{Binding shuxing}" margin="5,0" Foreground="OrangeRed"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</border>
</ScrollVIEwer>
</GrID>
2、自定义ListBox整体显示样式,以下可使其所有Item水平显示
<ListBox>
<ListBox.ItemsPanel>
<ItemsPanelTemplate >
<StackPanel OrIEntation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel> <ListBoxItem Content="选项1" WIDth="50" /> <ListBoxItem Content="选项2" WIDth="50" /> <ListBoxItem Content="选项3" WIDth="50" /> <ListBoxItem Content="选项4" WIDth="50" /> </ListBox>
以上是内存溢出为你收集整理的Silverlight ListBox全部内容,希望文章能够帮你解决Silverlight ListBox所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)