wpf中有圆角的listbox

<Style TargetType="{x:Type ListBox}">
<!-- 定义ListBox自身外观, 比如: 圆角边框-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBox">
<Border CornerRadius="5" Background="pink">
<ScrollViewer HorizontalScrollBarVisibility="Hidden">
<ItemsPresenter/>
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<ListBox Height="50" HorizontalAlignment="Left" Margin="236,84,0,0" Name="listBox1" VerticalAlignment="Top" Width="120" >
<ListBoxItem>wendyOne</ListBoxItem>
<ListBoxItem Foreground="White">wendyTwo</ListBoxItem>
<ListBoxItem>wendThree</ListBoxItem>
</ListBox>

posted on 2014-04-24 11:26  ExplorerMan  阅读(557)  评论(0编辑  收藏  举报

导航