Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

treenode editor imageindex not shown in custom treeview

Status
Not open for further replies.

zyanide

Programmer
Mar 13, 2006
2
ES
hi there, i need some support..
im building a custom treeview control, everything seems to go right, until i realized that the "treenode editor" in design view does not show the images stored in the imagelist that i already have binded to the treeview..
whats wrong? how can i see the indexed images in this dropdown list??

here is the source code of the custom Treeview:

public partial class Treeview : UserControl
{
public Treeview()
{
InitializeComponent();
this.label1.Text = this.Name;
}

private void Treeview_Load(object sender, EventArgs e)
{
}
/// <summary>
/// Gets the collection of System.Windows.Forms.TreeNode objects assigned to the current tree node.
/// </summary>
/// <returns>
/// A System.Windows.Forms.TreeNodeCollection that represents the tree nodes assigned to the current tree node.
/// </returns>

#region M E T H O D S

private void button1_MouseDown(object sender, MouseEventArgs e)
{
//button1.FlatStyle = FlatStyle.Popup;
}
private void button1_MouseUp(object sender, MouseEventArgs e)
{
//button1.FlatStyle = FlatStyle.Flat;
}
#endregion

#region P R O P E R T I E S
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public virtual TreeNodeCollection Nodes
{
get { return this.treeView1.Nodes; }
}
public string Caption
{
get { return label1.Text; }
set { label1.Text = value; }
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public virtual ImageList ImageList
{
get { return this.treeView1.ImageList; }
set { this.treeView1.ImageList = value; }
}
[Editor("System.Windows.Forms.Design.ImageIndexEditor", typeof(System.Drawing.Design.UITypeEditor))]
[TypeConverter(typeof(ImageIndexConverter))]
public int ImageIndex
{
get { return this.treeView1.ImageIndex; }
set { this.treeView1.ImageIndex = value; }
}
#endregion



}

Thanx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top