Retrieves the item's ActiveX object associated, if the item was previously created by
InsertControlItem property.


| Type | Description | |||
| 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 Gantt1
.BeginUpdate
.ScrollBySingleLine = True
With Gantt1.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_gantt.GetItems();
m_gantt.BeginUpdate();
m_gantt.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_gantt.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 ExGantt Component:
axGantt1.BeginUpdate();
EXGANTTLib.Items items = axGantt1.Items;
axGantt1.ScrollBySingleLine = true;
int h = items.InsertControlItem(0, "Exontrol.Gantt","");
items.set_ItemHeight(h, 182);
object ganttInside = items.get_ItemObject(h);
if ( ganttInside != null )
{
EXGANTTLib.Gantt gantt = ganttInside as EXGANTTLib.Gantt;
if (gantt != null)
{
gantt.BeginUpdate();
gantt.LinesAtRoot = EXGANTTLib.LinesAtRootEnum.exLinesAtRoot;
gantt.Columns.Add("Column 1");
gantt.Columns.Add("Column 2");
gantt.Columns.Add("Column 3");
EXGANTTLib.Items itemsInside = gantt.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");
gantt.EndUpdate();
}
}
axGantt1.EndUpdate();
The following VB.NET sample adds the Exontrol's ExOrgChart Component:
With AxGantt1
.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.Gantt1
.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