C# Winform:我现在需要扩展一下TreeNode类  主要目的: 
1. 想改变.NET中原来的TreeNode的高度  原来的TreeNode里只能写一行字,我想在TreeNode里分开写两行;
2. 在TreeNode的贴一张BitMap  可以用Label  或  PicutreBox等  (也是集成在TreeNode里面的)有点像QQ里面的那个样子;namespace 扩展TreeNode类
{
    class TreeNodeEx : TreeNode 
    {
        .....
    }
}
可能暂时分不够, 一定加到满意为止。  望大家帮帮小弟,顶者有分。

解决方案 »

  1.   

    TreeNode居然连Height和Width都没有   这对改变高度就难办了
      

  2.   

    一个很粗略的示例。只是在TreeNode里显示两行文字。有很多细节没处理,不过可以作为一个开始。    public class MyTreeNode : TreeNode
        {
            public MyTreeNode(string text, string details)
                :base(text)
            {
                this.Details = details;
            }        public string Details { get; set; }
        }    public class MyTreeView : TreeView
        {
            public MyTreeView()
            {
                this.ItemHeight = 100;
                this.DrawMode = TreeViewDrawMode.OwnerDrawText;
                DetailFont = Font;
                DetailColor = ForeColor;
            }        public Font DetailFont { get; set; }        public Color DetailColor { get; set; }        protected override void OnDrawNode(DrawTreeNodeEventArgs e)
            {
                Rectangle rect = e.Bounds;
                MyTreeNode node = e.Node as MyTreeNode;
                e.Graphics.DrawString(node.Text, Font, new SolidBrush(ForeColor), rect.Left, rect.Top);
                e.Graphics.DrawString(node.Details, DetailFont, new SolidBrush(DetailColor), rect.Left, rect.Top + 50);
            }
        }
      

  3.   

    试第三方控件,自己写太痛苦了。
    Infragistics.UltraTree可以满足你的部分要求。