|
NodeImage node control
Saturday, 12 September 2009
NodeImage allows you to show an image inside a node and supports image animation. Note that it supports only 32 bit per pixel bitmaps at this time. Example: Use the built–in NodeWithImage node class to show an image: // create the node control in run–time (or do it in the Visual Studio designer). NodeImage ctrl = new NodeImage(); ctrl.AttachTo(tree); NodeWithImage node = new NodeWithImage("test", Recources.myIcon); node.AttachTo(tree); Use a custom node class to show an image: class MyNode : Node { private Bitmap m_Icon; public Bitmap Icon { get { return m_Icon; } set { m_Icon = value; } } public MyNode(string pText, Bitmap pIcon) : base(pText) { Icon = pIcon; } } NodeImage ctrl = new NodeImage(); // attach the node control to the node`s Icon property. ctrl.DataFieldName = "Icon"; tree.NodeControls.Add(ctrl); NodeEx node = new MyNode("test", Recources.myIcon); node.AttachTo(tree);
|
|