C# 弯曲silverlight listbox控件的边框
弯曲silverlight列表框控件的边框: 我只想弯曲silverlight列表框边框的端点 因为我无法获得边界曲线,所以我是否有任何错误:C# 弯曲silverlight listbox控件的边框,c#,silverlight,C#,Silverlight,弯曲silverlight列表框控件的边框: 我只想弯曲silverlight列表框边框的端点 因为我无法获得边界曲线,所以我是否有任何错误: <Style TargetType="ListBox" x:Key="listboxStyle"> <Setter Property="Padding" Value="1"/> <Setter Property="Background" Value="Transparent" /> <
<Style TargetType="ListBox" x:Key="listboxStyle">
<Setter Property="Padding" Value="1"/>
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Top" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="TabNavigation" Value="Once" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBox">
<Grid Background="White">
<Border Background="White" BorderThickness="0" CornerRadius="10">
<ScrollViewer Background="White" x:Name="ScrollViewerElement" Padding="{TemplateBinding Padding}">
<ItemsPresenter />
</ScrollViewer>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
请检查如何编辑ListBox或任何WPF控件的控件模板- 您可以在controltemplate内的边框上指定CornerRadius。检查此部分 具有模板和控制模板的最小模板ListBox和ListBoxItem: 那篇博文的作者
我记得博客的作者是listbox控件的作者。好的,我已经完成了,不需要设置listbox控件的样式
<Border BorderBrush="White" BorderThickness="0" CornerRadius="5" Background="White" >
<ListBox x:Name="lstEnities" BorderThickness="0" Margin="5" Grid.Row="0"></ListBox>
</Border>
很好,非常优雅,组成FTW,+1