请问要个VB的Treeview控件加上背景颜色该怎么办啊 ??

解决方案 »

  1.   

    API自己声明吧Dim lngStyle As Long
    Call SendMessage(TreeView1.hWnd, TVM_SETBKCOLOR, 0, ByVal RGB(255, 0, 0))
    '改变背景到红色lngStyle = GetWindowLong(TreeView1.hWnd, GWL_STYLE)
    Call SetWindowLong(TreeView1.hWnd, GWL_STYLE, lngStyle - TVS_HASLINES)
    Call SetWindowLong(TreeView1.hWnd, GWL_STYLE, lngStyle)
      

  2.   

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

  3.   

    以上的方法是有缺陷的。这个是由于树控件本身造成的。所以最好去用activetree,他最好了。
      

  4.   

    activetree算什么东西VB的TreeView控件功能弱在于MicroSoft将它封装得太“好”了
    实际上VB的TreeView控件是调用Windows系统的ListView控件Windows系统的ListView控件功能非常强
    特别是支持“Custom Draw”,允许用户自己处理项目绘制。ACDSee的缩略图视图就是利用“Custom Draw”实现的