event AddItem (Item as Item)
Occurs when a new item is added to a group.

 TypeDescription 
   Item as Item An Item object that's added to Group items collection.  

Use the AddItem event to notify your application that a new Item was added to Group. Use the Group property to get the owner group of the item. The AddItem method fires the AddItem event each time when a new item is added to items of the Group. Use the Add method to add new groups to the control. 

The following VB sample changes the item's alignment when a new items is added to the first group:

Private Sub ExplorerBar1_AddItem(ByVal Item As EXPLORERBARLibCtl.IItem)
    With Item
        If (.Group.Index = 0) Then
            .Alignment = exRight
        End If
    End With
End Sub

The following C++ sample changes the item's alignment when a new items is added to the first group:

void OnAddItemExplorerbar1(LPDISPATCH Item) 
{
	CItem item( Item ); item.m_bAutoRelease = FALSE;
	if ( item.GetGroup().GetIndex() == 0 )
		item.SetAlignment( 2 /*exRight*/ );
}

The following VB.NET sample changes the item's alignment when a new items is added to the first group:

Private Sub AxExplorerBar1_AddItem(ByVal sender As Object, ByVal e As AxEXPLORERBARLib._IExplorerBarEvents_AddItemEvent) Handles AxExplorerBar1.AddItem
    With e.item
        If (.Group.Index = 0) Then
            .Alignment = EXPLORERBARLib.AlignmentEnum.exRight
        End If
    End With
End Sub

The following C# sample changes the item's alignment when a new items is added to the first group:

private void axExplorerBar1_AddItem(object sender, AxEXPLORERBARLib._IExplorerBarEvents_AddItemEvent e)
{
	if (e.item.Group.Index == 0)
		e.item.Alignment = EXPLORERBARLib.AlignmentEnum.exRight;
}

The following VFP sample changes the item's alignment when a new items is added to the first group:

*** ActiveX Control Event ***
LPARAMETERS item

with item
	If (.Group.Index = 0) Then
		.Alignment = 2 && exRight
	EndIf
endwith

 


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