method Items.InsertObjectItem (Parent as HITEM, [UserData as Variant], [Obj as Variant])
Inserts a new item that hosts the giving object, and returns a handle to the newly created item.
| | Type | Description | |
| |
Parent as HITEM |
A long expression that indicates the handle of the parent item where
the object will be inserted. If the argument is missing then the
InsertObjectItem property inserts the object as a root item.
If the Parent property is referring a locked item ( ItemLocked
property ), the InsertObjectItem property doesn't insert a new child,
instead places the object to the locked item that's specified by the
Parent property.
| |
| |
UserData as Variant |
A VARIANT expression being specified at creating time, which can be accessed
during the ViewItemUpdate(exAddItem) event. The ItemData
property indicates the extra data associated with any item. The ItemData
property is initalized with the value of the UserData parameter.
| |
| |
Obj as Variant |
A object being hosted. The most common type is System.Windows.Forms.Control from
the /NET framework. Generally, the Obj could be any control that can be placed
to a form or dialog and it is visible at runtime. The Obj can not be a
windowless control ( a control that does not require a window, such a line or
circle ). The Obj parameter could be also an ActiveX control ( that has already
being placed in the form/dialog) in this case, the Obj should be the result of
the property Object() (VB6, VFP ). GetOcx() property. Finally, the Obj parameter
could be of long type ( numeric ) in which case it should refer the handle of a
window that follows to be hosted in the newly created item. The handle of the
window can be obtained as m_hWnd member of MFC classes, hWnd or Handle property
in the /NET framework. After creating the host, the ItemObject
property can be used to retrieve the originally object ( Obj parameter ).
| |