Silverlight ListBox

Silverlight ListBox,第1张

概述1、自定义ListBoxItem <Grid x:Name="LayoutRoot" Background="Transparent">      <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">       <Border Style="{StaticResource Co

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所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1067530.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存