wpf中有圆角的listbox

来源:互联网 发布:mmd美腿战队数据 编辑:程序博客网 时间:2024/05/22 14:30
 
       <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>

原创粉丝点击