custom treenode, labels not visible

Mar 25 2010 11:43 AM
Hi,

I've made a custom TreeNode and TreeView, to add some functionality I need in my application. I've added a textbox and two extra labels to the treenode. The textbox is shown when the treenode is selected, and this works perfectly.
However the extra labels should always be visible, but they are never shown.
Below is the code from the constructor, where textbox and labels are created.

 public TextBoxTreeNode(string text, string value, string unit) : base(text) {
            this.textbox = new TextBox();
            textbox.Text = value;
            this.value = new Label();
            this.value.Text = value;
            this.unit = new Label();
            this.unit.Text = unit;
            this.value.AutoSize = true;
            this.value.SetBounds(
                    this.Bounds.X + this.Bounds.Width + 5,
                    this.Bounds.Y,
                    this.value.Bounds.Width,
                    this.value.Bounds.Height);
            this.value.Show();
            this.value.Visible = true;
            this.unit.AutoSize = true;
            this.unit.SetBounds(
                    this.Bounds.X + this.Bounds.Width + this.value.Bounds.Width + 5,
                    this.Bounds.Y,
                    this.unit.Bounds.Width,
                    this.unit.Bounds.Height);
            this.unit.Show();
            this.unit.Visible = true;
        }
Edit: Added codefile as download, cause the forum realy f*cks up my code...

Attachment: TextBoxTreeView.zip