如何设置 ListView 中特定列的字体颜色? 我在 ListView 中有两列,我想将第二列中的字体设置为红色。
最佳答案
使用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);
}
}
关于c# - 如何设置 ListView 中特定列的字体颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13151608/