Bypassing the TreeView.ItemHeight Limitation

Thursday Jul 10th 2003 by Fermy Olivier
Share:

Learn to get around the limitation for the maximum value of the .NET TreeView's ItemHeight property.

Environment: .NET, C#

The property ItemHeight of the "System.Windows.Forms.TreeView" .NET control allows you to set the height of each item in your TreeView. It's a bit surprising, but .NET libraries developers have set a maximum value for this property.

If you set an item's height to greater than 24 pixels, the value is automatically reduced to 24 pixels before being processed. To bypass this limitation, you can override the TreeView class and the WndProc method, and then modify the parameters of the TVM_SETITEMHEIGHT message.

The source code that can be downloaded will help you to better understand the concept.

Downloads

Download source - 1 Kb
Share:
Home
Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved