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

  • Email is the most common communication vehicle used by organizations of all shapes and sizes. Among the billions of email messages sent every day are sensitive information, critical requests, and other essential business data. IT staff bear the burden of ensuring the confidentiality, integrity, and availability of the information contained within the communication. This white paper explores the email security landscape, an assessment of the threats organizations face,  and the building blocks of an effective …

  • The latest release of SugarCRM's flagship product gives users new tools to build extraordinary customer relationships. Read an in-depth analysis of SugarCRM's enhanced ability to help companies execute their customer-facing initiatives from Ovum, a leading technology research firm.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds