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

  • Live Event Date: November 20, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT Are you wanting to target two or more platforms such as iOS, Android, and/or Windows? You are not alone. 90% of enterprises today are targeting two or more platforms. Attend this eSeminar to discover how mobile app developers can rely on one IDE to create applications across platforms and approaches (web, native, and/or hybrid), saving time, money, and effort and introducing apps to market faster. You'll learn the trade-offs for gaining long …

  • IBM Worklight is a mobile application development platform that lets you extend your business to mobile devices. It is designed to provide an open, comprehensive platform to build, run and manage HTML5, hybrid and native mobile apps.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds