

| Type | Description | |||
| AlignmentEnum | An AlignmentEnum expression that indicates the item's alignment. |
By default, the item's alignment is exCenter. Use the AddItem event to change the alignment for all items into a group, like in the following samples. Use the ItemHeight property to specify the height for all items in the control. Use the Image property to assign a picture to an item. Use the Caption property to specify the caption of the item.
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