如何在列表视图中为特定列设置字体颜色?
我在列表视图中有两列,我想将第二列的字体设置为红色。
最佳答案
使用ListView.DrawColumnHeader
事件
private void listView1_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
// Draw the header text.
using (Font headerFont =
new Font("Helvetica", 10, FontStyle.Bold, FontColor.Red))
{
e.Graphics.DrawString(e.Header.Text, headerFont,
Brushes.Black, e.Bounds, sf);
}
}