event ItemOleEvent (Group as Group, Item as HITEM, Ev as OleEvent)
Fired when an ActiveX control hosted by an item has fired an event.

 TypeDescription 
   Group as Group A Group object  
   Item as HITEM A long expression that indicates the handle of the item that hosts an ActiveX control.  
   Ev as OleEvent An OleEvent object that contains information about the fired event.  
The ExplorerTree control supports ActiveX hosting. The InsertItemControl method inserts an item that hosts an ActiveX control. The ItemOleEvent event notifies your application when a hosted ActiveX control fires an event. 

 The following sample adds an item that hosts the Microsoft Calendar Control and prints each event fired by this ActiveX control:

Private Sub ExplorerTree1_ItemOleEvent(ByVal Group As EXPLORERTREELibCtl.IGroup, ByVal Item As EXPLORERTREELibCtl.HITEM, ByVal Ev As EXPLORERTREELibCtl.IOleEvent)
    Debug.Print "Event name:" & Ev.Name
   If (Ev.CountParam = 0) Then
      Debug.Print "The event has no arguments."
   Else
      Debug.Print "The event has the following arguments:"
      Dim i As Long
      For i = 0 To Ev.CountParam - 1
         Debug.Print Ev(i).Name; " = " & Ev(i).Value
      Next
   End If
End Sub

Private Sub Form_Load()
    With ExplorerTree1
        With .Groups.Add("Group 1")
            .Height = 172
            .Expanded = True
            .Items.ItemHeight(.Items.InsertControlItem(, "MSCAL.Calendar")) = .Height
        End With
    End With
End Sub

The ItemObject property gets the ActiveX object hosted by an item that is inserted using the InsertControlItem method. The ItemObject property gets nothing if the item doesn't host an ActiveX control, or if inserting an ActiveX control failed ).


Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.