Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TreeView BackGround Colour
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
TreeView BackGround Colour
Miscellaneous
Thread ID:
00642611
Message ID:
00642611
Views:
77
Hi all,

I've been trying to change the Background colour for a simple TreeView. I was given the reference to the Basic example but have been unable to translated it correctly as I'm still getting a small patch of white appearing. Here is my code. (VF7)
With ThisForm.tvSelected

  With .Nodes
    loNode = .Add(.NULL., .NULL., "A", "First Order")
    loNode.BackColor = Rgb(192,192,192)
    loNode = .Add("A", 4, "B", "Second Order")
    loNode.BackColor = Rgb(192,192,192)
    loNode = .Add("B", 4, "C", "Third Order")
    loNode.BackColor = Rgb(192,192,192)
    loNode = .Add("C", 4, "D", "Fourth Order")
    With loNode
        .BackColor = Rgb(192,192,192)
        .Expanded = .T.
	.EnsureVisible()
    EndWith
  EndWith

  Declare integer SendMessageA in Win32API as SendMessage integer hWND, integer wMsg, integer wParam, integer lParam
  Declare integer GetWindowLongA in Win32API as GetWindow integer hWND, integer nIndex
  Declare integer SetWindowLongA in Win32API as SetWindow integer hWND, integer nIndex, integer nNewIndex

  #define TV_SetBackColour	0x1100 + 29
  #define TV_HasLines				2
  #define TV_Style					-16

  ThisForm.Visible = .T.
    lnStyle = GetWindow(.hWnd, TV_Style)
    =SetWindow(.hWnd, TV_Style, lnStyle - TV_HasLines)
    =SendMessage(.hWnd, TV_SetBackColour, 0, Rgb(192,192,192))
    *-- Reset the Style so that the TreeView appear properly.
    =SetWindow(.hWnd, TV_Style, lnStyle)
  EndWith
EndWith
Any help would be appreciated.
Caroline
Next
Reply
Map
View

Click here to load this message in the networking platform