Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools


Click here to copy the following block
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As _
  Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd _
  As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd _
  As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Const 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, lStyle
End Sub


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.