listview 的 view 设为details后listview 的 Columnheader 怎么改变颜色

解决方案 »

  1.   

    只有自己继承此控件,然后覆写PAINT方法,自己画.
      

  2.   

    不太可能做。
    ListView的ColumnHeader是最差劲的东东,什么也扩展不了。不知2005的有没有改善
      

  3.   

    设置该listview的owerDraw属性为true,然后   Private Sub ListView1_DrawColumnHeader(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DrawListViewColumnHeaderEventArgs) Handles ListView1.DrawColumnHeader
            Dim strFormat As New StringFormat()
            If e.Header.TextAlign = HorizontalAlignment.Center Then
                strFormat.Alignment = StringAlignment.Center
            ElseIf e.Header.TextAlign = HorizontalAlignment.Right Then
                strFormat.Alignment = StringAlignment.Far
            End If        e.DrawBackground()
            e.Graphics.FillRectangle(Brushes.SteelBlue, e.Bounds)
            Dim headerFont As New Font("Arial", 8, FontStyle.Bold)        e.Graphics.DrawString(e.Header.Text, headerFont, Brushes.White, e.Bounds, strFormat)
        End Sub