property Items.ItemObject (Item as HITEM) as Object

Retrieves the item's ActiveX object associated, if the item was previously created by InsertControlItem property. /*not supported in the lite version*/

TypeDescription
Item as HITEM A long expression that indicates the handle of the item that was previously created by InsertControlItem property.
Object An object that indicates the ActiveX hosted by the item.

Use the ItemObject to retrieve the ActiveX control created by the InsertControlItem method. Use the ItemControlID property to retrieve the control's identifier. Use the ItemHeight property to specify the item's height. If the item hosts an ActiveX control, the ItemHeight property specifies the height of the ActiveX control also.

The following VB sample adds the Exontrol's ExCalendar Component:

With Tree1
    .BeginUpdate
    .ScrollBySingleLine = True
    With Tree1.Items
        Dim h As HITEM
        h = .InsertControlItem(, "Exontrol.Calendar")
        .ItemHeight(h) = 182
        With .ItemObject(h)
            .Appearance = 0
            .BackColor = vbWhite
            .ForeColor = vbBlack
            .ShowTodayButton = False
        End With
    End With
    .EndUpdate
End With

 

 

The following C++ sample adds the Exontrol's ExOrgChart Component:

#include "Items.h"

#pragma warning( disable : 4146 )
#import <ExOrgChart.dll> 

CItems items = m_tree.GetItems();
m_tree.BeginUpdate();
m_tree.SetScrollBySingleLine( TRUE );
COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR;
long h = items.InsertControlItem( 0, "Exontrol.ChartView", vtMissing );
items.SetItemHeight( h, 182 );
EXORGCHARTLib::IChartViewPtr spChart( items.GetItemObject(h) );
if ( spChart != NULL )
{
	spChart->BeginUpdate();
	spChart->BackColor = RGB(255,255,255);
	spChart->ForeColor = RGB(0,0,0);
	EXORGCHARTLib::INodesPtr spNodes = spChart->Nodes;
	spNodes->Add( "Child 1", "Root", "1", vtMissing, vtMissing );
	spNodes->Add( "SubChild 1", "1", vtMissing, vtMissing, vtMissing );
	spNodes->Add( "SubChild 2", "1", vtMissing, vtMissing, vtMissing );
	spNodes->Add( "Child 2", "Root", vtMissing, vtMissing, vtMissing );
	spChart->EndUpdate();
}
m_tree.EndUpdate();

The sample uses the #import statement to include the ExOrgChart's Type Library. In this sample, the ItemObject property retrieves an IChartView object. The path to the library should be provided in case it is not located in your system folder.  

The following C# sample adds the Exontrol's ExTree Component:

axTree1.BeginUpdate();
EXTREELib.Items items = axTree1.Items;
axTree1.ScrollBySingleLine = true;
int h = items.InsertControlItem(0, "Exontrol.Tree","");
items.set_ItemHeight(h, 182);
object treeInside = items.get_ItemObject(h);
if ( treeInside != null )
{
	EXTREELib.Tree tree = treeInside as EXTREELib.Tree;
	if (tree != null)
	{
		tree.BeginUpdate();
		tree.LinesAtRoot = EXTREELib.LinesAtRootEnum.exLinesAtRoot;
		tree.Columns.Add("Column 1");
		tree.Columns.Add("Column 2");
		tree.Columns.Add("Column 3");
		EXTREELib.Items itemsInside = tree.Items;
		int hInside = itemsInside.AddItem("Item 1");
		itemsInside.set_CellCaption(hInside, 1, "SubItem 1");
		itemsInside.set_CellCaption(hInside, 2, "SubItem 2");
		hInside = itemsInside.InsertItem(hInside, null, "Item 2");
		itemsInside.set_CellCaption(hInside, 1, "SubItem 1");
		itemsInside.set_CellCaption(hInside, 2, "SubItem 2");
		tree.EndUpdate();
	}
}
axTree1.EndUpdate();

The following VB.NET sample adds the Exontrol's ExOrgChart Component:

With AxTree1
    .BeginUpdate()
    .ScrollBySingleLine = True
    With .Items
        Dim hItem As Integer
        hItem = .InsertControlItem(, "Exontrol.ChartView")
        .ItemHeight(hItem) = 182
        With .ItemObject(hItem)
            .BackColor = ToUInt32(Color.White)
            .ForeColor = ToUInt32(Color.Black)
            With .Nodes
                .Add("Child 1", , "1")
                .Add("SubChild 1", "1")
                .Add("SubChild 2", "1")
                .Add("Child 2")
            End With
        End With
    End With
    .EndUpdate()
End With

The following VFP sample adds the Exontrol's ExGrid Component:

with thisform.Tree1
	.BeginUpdate()
	.ScrollBySingleLine = .t.
	with .Items
		.DefaultItem = .InsertControlItem(0, "Exontrol.Grid")
		.ItemHeight( 0 ) = 182
		with .ItemObject( 0 )
			.BeginUpdate()
			with .Columns
				with .Add("Column 1").Editor()
					.EditType = 1 && EditType editor
				endwith
			endwith
			with .Items
				.AddItem("Text 1")
				.AddItem("Text 2")
				.AddItem("Text 3")
			endwith
			.EndUpdate()
		endwith
	endwith
	.EndUpdate()
endwith