Dim nodex As Node Dim i As Integer Dim lStyle As Long Call SendMessage(TreeView1.hWnd, TVM_SETBKCOLOR, 0, ByVal RGB(255, 0, 0)) lStyle = GetWindowLong(TreeView1.hWnd, GWL_STYLE) Call SetWindowLong(TreeView1.hWnd, GWL_STYLE, lStyle - TVS_HASLINES) Call SetWindowLong(TreeView1.hWnd, GWL_STYLE, lStyle) TreeView1.Style = tvwTreelinesPlusMinusPictureText TreeView1.BorderStyle = ccFixedSingle With TreeView1.Nodes Set nodex = .Add(, , "R", "Root") nodex.BackColor = RGB(255, 0, 0) For i = 1 To 10 Set nodex = .Add("R", tvwChild, "C" & i, "Child " & i) nodex.BackColor = RGB(255, 0, 0) nodex.EnsureVisible Next End With End Sub |