Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/320.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 弯曲silverlight listbox控件的边框_C#_Silverlight - Fatal编程技术网

C# 弯曲silverlight listbox控件的边框

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" /> <

弯曲silverlight列表框控件的边框:

我只想弯曲silverlight列表框边框的端点

因为我无法获得边界曲线,所以我是否有任何错误:

  <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