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 the Group's items collection. 

Use the AddItem event to notify your application that a new Item was added to Group. Use the Group property to find out the item's owner Group. The AddItem method fires the AddItem event each time when a new item was added to items Group collection. Use the SelectItem property to get the index of the selected item. Use the SelectGroup property to get the index of the selected group. Use the Add method to add new groups to the control. 

Syntax for AddItem event, /NET version, on:

private void AddItem(object sender,exontrol.EXLISTBARLib.Item Item)
{
}

Private Sub AddItem(ByVal sender As System.Object,ByVal Item As exontrol.EXLISTBARLib.Item) Handles AddItem
End Sub

Syntax for AddItem event, /COM version, on:

private void AddItem(object sender, AxEXLISTBARLib._IListBarEvents_AddItemEvent e)
{
}

void OnAddItem(LPDISPATCH Item)
{
}

void __fastcall AddItem(TObject *Sender,Exlistbarlib_tlb::IItem *Item)
{
}

procedure AddItem(ASender: TObject; Item : IItem);
begin
end;

procedure AddItem(sender: System.Object; e: AxEXLISTBARLib._IListBarEvents_AddItemEvent);
begin
end;

begin event AddItem(oleobject Item)
end event AddItem

Private Sub AddItem(ByVal sender As System.Object, ByVal e As AxEXLISTBARLib._IListBarEvents_AddItemEvent) Handles AddItem
End Sub

Private Sub AddItem(ByVal Item As EXLISTBARLibCtl.IItem)
End Sub

Private Sub AddItem(ByVal Item As Object)
End Sub

LPARAMETERS Item

PROCEDURE OnAddItem(oListBar,Item)
RETURN

Syntax for AddItem event, /COM version (others), on:

<SCRIPT EVENT="AddItem(Item)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function AddItem(Item)
End Function
</SCRIPT>

Procedure OnComAddItem Variant llItem
	Forward Send OnComAddItem llItem
End_Procedure

METHOD OCX_AddItem(Item) CLASS MainDialog
RETURN NIL

void onEvent_AddItem(COM _Item)
{
}

function AddItem as v (Item as OLE::Exontrol.ListBar.1::IItem)
end function

function nativeObject_AddItem(Item)
return

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

Private Sub ListBar1_AddItem(ByVal Item As EXLISTBARLibCtl.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 OnAddItemListbar1(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 AxListBar1_AddItem(ByVal sender As Object, ByVal e As AxEXLISTBARLib._IListBarEvents_AddItemEvent) Handles AxListBar1.AddItem
    With e.item
        If (.Group.Index = 0) Then
            .Alignment = EXLISTBARLib.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 axListBar1_AddItem(object sender, AxEXLISTBARLib._IListBarEvents_AddItemEvent e)
{
	if (e.item.Group.Index == 0)
		e.item.Alignment = EXLISTBARLib.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

 

Private Sub ListBar1_AddItem(ByVal Item As EXLISTBARLibCtl.IItem)
    If (Item.Group.Index = 0) Then
        Item.Alignment = exRight
    End If
End Sub