Bypassing the TreeView.ItemHeight Limitation

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


Comments

  • How do you bypass the Menuitem bounds???

    Posted by Legacy on 07/29/2003 12:00am

    Originally posted by: Thomas Jacobsen

    when i override the menuitem onDrawitem(), I can't draw a selection bar to the edge , but if i can bypass the size in anyway.

    Reply
  • Can this be called an article? Boo...

    Posted by Legacy on 07/10/2003 12:00am

    Originally posted by: CodeGuru

    and no stuff what u did .... sign

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • This paper introduces IBM Java on the IBM PowerLinux 7R2 server and describes IBM's implementation of the Java platform, which includes IBM's Java Virtual Machine and development toolkit.

  • Protecting business operations means shifting the priorities around availability from disaster recovery to business continuity. Enterprises are shifting their focus from recovery from a disaster to preventing the disaster in the first place. With this change in mindset, disaster recovery is no longer the first line of defense; the organizations with a smarter business continuity practice are less impacted when disasters strike. This SmartSelect will provide insight to help guide your enterprise toward better …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds