Version

ImageSize Property

Gets/sets the size of the images if no UltraTree.ImageList is supplied.
Syntax
'Declaration
 
Public Property ImageSize As Size
public Size ImageSize {get; set;}
Remarks

If the image of the node is from an ImageList control, the ImageSize of the ImageList will be used and this property is ignored.

If the image is added directly to the Appearance of the node, then ImageSize will resize the image to the specified size. The Image will be stretched or shrunk to fit the ImageSize.

Example
The following sample code illustrates how to specify the image size to use for node images.

Imports Infragistics.Win

Private Sub button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button5.Click

    ' Note: the Override objects are exposed as properties off
    ' the tree, the node and the nodes collection as well as
    ' items in the NodeLevelOverrides collection. This allows
    ' default settings to be specified for the tree, a node, 
    ' a node's children or for a level in the tree.

    ' Reserve space for images even if a node doesn't have one.
    Me.ultraTree1.Override.ReserveImageSpace = DefaultableBoolean.True

    ' Use the tree's Override property to
    ' set the default for all nodes.
    Me.ultraTree1.Override.ImageSize = New Size(16, 16)

    ' Set the default for nodes that are at level 2 
    ' (i.e. grandchild nodes of root modes).
    ' This overrides the default setting above.
    Me.ultraTree1.NodeLevelOverrides(2).ImageSize = New Size(0, 0)

    ' Set the default for nodes at the root level. 
    ' This overrides the default settings above.
    Me.ultraTree1.Nodes.Override.ImageSize = New Size(32, 32)

    Dim node As UltraTreeNode

    ' Get a specific node by its key value. 
    ' Note: this will return the node that has that key
    ' from anywhere in the tree structure since keys are
    ' unique across the entire tree.
    node = Me.ultraTree1.GetNodeByKey("child node 1")

    ' Set the property for that specific node only.
    ' This overrides any default settings above.
    node.Override.ImageSize = New Size(48, 48)

    ' Set the property for that specific node's child nodes
    node.Nodes.Override.ImageSize = New Size(32, 32)

End Sub
using Infragistics.Win;

private void button5_Click(object sender, System.EventArgs e)
{

	// Note: the Override objects are exposed as properties off
	// the tree, the node and the nodes collection as well as
	// items in the NodeLevelOverrides collection. This allows
	// default settings to be specified for the tree, a node, 
	// a node's children or for a level in the tree.
 
	// Reserve space for images even if a node doesn't have one.
	this.ultraTree1.Override.ReserveImageSpace = DefaultableBoolean.True;

	// Use the tree's Override property to
	// set the default for all nodes.
	this.ultraTree1.Override.ImageSize = new Size(16, 16);
		
	// Set the default for nodes that are at level 2 
	// (i.e. grandchild nodes of root modes).
	// This overrides the default setting above.
	this.ultraTree1.NodeLevelOverrides[2].ImageSize = new Size(0, 0);

	// Set the default for nodes at the root level. 
	// This overrides the default settings above.
	this.ultraTree1.Nodes.Override.ImageSize = new Size(32, 32);

	// Get a specific node by its key value. 
	// Note: this will return the node that has that key
	// from anywhere in the tree structure since keys are
	// unique across the entire tree.
	UltraTreeNode node = this.ultraTree1.GetNodeByKey("child node 1");

	// Set the property for that specific node only.
	// This overrides any default settings above.
	node.Override.ImageSize = new Size(48, 48);

	// Set the property for that specific node's child nodes
	node.Nodes.Override.ImageSize = new Size(32, 32);
		
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also