我设置了ListViewGroup
标头的ListView
控件。我想将组标题的文本设置为粗体。有没有其他选择来实现这一点?
使用粗体从项目创建临时字体
##
using(Font f= new Font(listView1.Items(0).SubItems(0).Font, FontSytle.Bold))
{
}
您可以使用以下 xaml
<ListView Name="lvUsers">
<ListView.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock FontWeight="Bold" FontSize="14" Text="{Binding Name}"/>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</ListView.GroupStyle>
</ListView>