property Item.Alignment as AlignmentEnum
Specifies the item's alignment.

TypeDescription
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 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