Results 1 to 2 of 2

Thread: treeview color problem..

  1. #1

    Thread Starter
    Lively Member Scorpionz's Avatar
    Join Date
    Feb 1999
    Location
    lafayette/kaplan, louisiana, usa
    Posts
    72

    Angry

    windows 95b
    vb v5.0
    tree view activex control v6.0

    i'm having a problem with this treeview color function..

    http://xiner.virtualave.net/gamescope/images/ss8.jpg

    it colors everything except the back color of where the text is..

    here is the code:

    With lstgames
    Call SendMessage(.hwnd, TVM_SETBKCOLOR, 0, ByVal &HF1CBA8)
    Call SendMessage(.hwnd, TVM_SETTEXTCOLOR, 0, ByVal &H800000)

    lngStyle = GetWindowLong(.hwnd, GWL_STYLE)

    If lngStyle And TVS_HASLINES Then
    Call SetWindowLong(.hwnd, GWL_STYLE, lngStyle Xor TVS_HASLINES)
    Call SetWindowLong(.hwnd, GWL_STYLE, lngStyle)
    End If
    End With

  2. #2
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Bethel, North Carolina, USA
    Posts
    987
    Try adding this directly after the With statement...

    Code:
    'general declarations 
    Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
    Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
    Private Const TRANSPARENT = 1
    '
    ' directly after with statement
    SetBkMode GetDC(.hwnd), TRANSPARENT
    If that doesn't work see if there is a TVM_SETFILLCOLOR flag (to change the fillcolor) and set it to the same value of the BackColor of the Treeview.
    {Insert random techno-babble here}

    {Insert quote from some long gone mofo here}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width