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

Get or Set the height of TreeView nodes

Total Hit ( 3852)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


In plain VB there is no way to determine or change the height of node elements in a TreeView control. All you need to accomplish both tasks, however, is send the right message to the control.

Click here to copy the following block
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal _
  hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
  lParam As Any) As Long

Private Const TV_FIRST = &H1100
Private Const TVM_SETITEMHEIGHT = (TV_FIRST + 27)
Private Const TVM_GETITEMHEIGHT = (TV_FIRST + 28)

' return the height of a TreeView's individual items
NodeHeight = SendMessage(TreeView1.hWnd, TVM_GETITEMHEIGHT, 0, ByVal 0&)

' set the height of a TreeView's individual items
' use the value -1 to restore default height
SendMessage TreeView1.hWnd, TVM_SETITEMHEIGHT, newNodeHeight, ByVal 0&


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.