如题。

解决方案 »

  1.   

    Private Const TVM_SETBKCOLOR = 4381&
    Private Const cnBackColor = &HA67563Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As LongCall SendMessage(Trv.hwnd, TVM_SETBKCOLOR, 0, ByVal cnBackColor)
      

  2.   


     Visual Basic Common Control API Routines
    Creating a Ledger-Style Listview Report Background 
          
    Posted:   Tuesday February 05, 2002 
    Updated:   Saturday September 14, 2002 
          
    Applies to:   VB6, or VB5 using APIs (not demonstrated) 
    Developed with:   VB6, Windows XP 
    OS restrictions:   None 
    Author:   VBnet - Randy Birch 
          
    Related:   Creating a Ledger-Style Listview Report Background with Custom Height
    Highlighting a Listview Report Column
    Highlighting and Maintaining a Listview Report Column through Subclassing
     
      

  3.   

    Option Explicit
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ' Copyright ?1996-2003 VBnet, Randy Birch, All Rights Reserved.
    ' Some pages may also contain other copyrights by the author.
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ' Distribution: You can freely use this code in your own
    '               applications, but you may not reproduce 
    '               or publish this code on any web site,
    '               online service, or distribute as source 
    '               on any media without express permission.
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
      

  4.   

    Private Enum ImageSizingTypes
       [sizeNone] = 0
       [sizeCheckBox]
       [sizeIcon]
    End EnumPrivate Enum LedgerColours
      vbledgerWhite = &HF9FEFF
      vbLedgerGreen = &HD0FFCC
      vbLedgerYellow = &HE1FAFF
      vbLedgerRed = &HE1E1FF
      vbLedgerGrey = &HE0E0E0
      vbLedgerBeige = &HD9F2F7
      vbLedgerSoftWhite = &HF7F7F7
      vbledgerPureWhite = &HFFFFFF
    End Enum'/* Below used for listview column auto-resizing
    Private Const LVM_FIRST As Long = &H1000
    Private Const LVM_SETCOLUMNWIDTH As Long = (LVM_FIRST + 30)
    Private Const LVSCW_AUTOSIZE As Long = -1
    Private Const LVSCW_AUTOSIZE_USEHEADER As Long = -2Private Declare Function SendMessage Lib "user32" _
       Alias "SendMessageA" _
      (ByVal hwnd As Long, _
       ByVal wMsg As Long, _
       ByVal wParam As Long, _
       lParam As Any) As Long
    Private Sub Form_Load()   Command1.Caption = "Text Only"
       Command2.Caption = "Text && Checks"
       Command3.Caption = "Text && Icons"
       
    End Sub
      

  5.   

    用相应的系统通用Treeview和listview的api不过色值与一般色值不对应
    或用子类技术
      

  6.   

    http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=7273