SetTreeViewBackColor – Change the background color of a TreeView control

SetTreeViewBackColor – Change the background color of a TreeView control

Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As _    Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongDeclare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd _    As Long, ByVal nIndex As Long) As LongDeclare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd _    As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As LongConst GWL_STYLE = -16&Const TVM_SETBKCOLOR = 4381&Const TVS_HASLINES = 2&Sub SetTreeViewBackColor(TV As TreeView, ByVal BackColor As Long)    Dim lStyle As Long    Dim TVNode As node             ' set the BackColor for every node    For Each TVNode In TV.Nodes        TVNode.BackColor = BackColor    Next    ' set the BackColor for the TreeView's window    SendMessage TV.hwnd, TVM_SETBKCOLOR, 0, ByVal BackColor    ' get the current style    lStyle = GetWindowLong(TV.hwnd, GWL_STYLE)    ' temporary hide lines    SetWindowLong TV.hwnd, GWL_STYLE, lStyle And (Not TVS_HASLINES)    ' redraw lines    SetWindowLong TV.hwnd, GWL_STYLE, lStyleEnd Sub

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several