event SelectItem (OldItem as Item, NewItem as Item)
Occurs when an item is selected.

TypeDescription
OldItem as Item An Item object being unselected.
NewItem as Item An Item object being selected.

Use the SelectItem event to notify your application that a new item was selected. The SelectItem property fires the SelectItem event each time when a new item is selected. Use the SelectGroup event to notify your application that a new group was selected. Use the Caption property to get the caption of the item. Use the Caption property to get the caption of the group.

Syntax for SelectItem event, /NET version, on:

private void SelectItem(object sender,exontrol.EXLISTBARLib.Item OldItem,exontrol.EXLISTBARLib.Item NewItem)
{
}

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

Syntax for SelectItem event, /COM version, on:

private void SelectItem(object sender, AxEXLISTBARLib._IListBarEvents_SelectItemEvent e)
{
}

void OnSelectItem(LPDISPATCH OldItem,LPDISPATCH NewItem)
{
}

void __fastcall SelectItem(TObject *Sender,Exlistbarlib_tlb::IItem *OldItem,Exlistbarlib_tlb::IItem *NewItem)
{
}

procedure SelectItem(ASender: TObject; OldItem : IItem;NewItem : IItem);
begin
end;

procedure SelectItem(sender: System.Object; e: AxEXLISTBARLib._IListBarEvents_SelectItemEvent);
begin
end;

begin event SelectItem(oleobject OldItem,oleobject NewItem)
end event SelectItem

Private Sub SelectItem(ByVal sender As System.Object, ByVal e As AxEXLISTBARLib._IListBarEvents_SelectItemEvent) Handles SelectItem
End Sub

Private Sub SelectItem(ByVal OldItem As EXLISTBARLibCtl.IItem,ByVal NewItem As EXLISTBARLibCtl.IItem)
End Sub

Private Sub SelectItem(ByVal OldItem As Object,ByVal NewItem As Object)
End Sub

LPARAMETERS OldItem,NewItem

PROCEDURE OnSelectItem(oListBar,OldItem,NewItem)
RETURN

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

<SCRIPT EVENT="SelectItem(OldItem,NewItem)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function SelectItem(OldItem,NewItem)
End Function
</SCRIPT>

Procedure OnComSelectItem Variant llOldItem Variant llNewItem
	Forward Send OnComSelectItem llOldItem llNewItem
End_Procedure

METHOD OCX_SelectItem(OldItem,NewItem) CLASS MainDialog
RETURN NIL

void onEvent_SelectItem(COM _OldItem,COM _NewItem)
{
}

function SelectItem as v (OldItem as OLE::Exontrol.ListBar.1::IItem,NewItem as OLE::Exontrol.ListBar.1::IItem)
end function

function nativeObject_SelectItem(OldItem,NewItem)
return

The following VB sample displays the caption of the item being selected:

Private Sub ListBar1_SelectItem(ByVal Item As EXLISTBARLibCtl.IItem)
    Debug.Print Item.Caption
End Sub

The following C++ sample displays the caption of the item being selected:

void OnSelectItemListbar1(LPDISPATCH Item) 
{
	CItem item( Item ); item.m_bAutoRelease = FALSE;
	CString strOutput;
	strOutput.Format("%s", (LPCTSTR)item.GetCaption() );
	OutputDebugString( strOutput );		
}

The following VB.NET sample displays the caption of the item being selected:

Private Sub AxListBar1_SelectItem(ByVal sender As Object, ByVal e As AxEXLISTBARLib._IListBarEvents_SelectItemEvent) Handles AxListBar1.SelectItem
    With e.item
        Debug.WriteLine(.Caption)
    End With
End Sub

The following C# sample displays the caption of the item being selected:

private void axListBar1_SelectItem(object sender, AxEXLISTBARLib._IListBarEvents_SelectItemEvent e)
{
	System.Diagnostics.Debug.WriteLine(e.item.Caption);
}

The following VFP sample displays the caption of the item being selected:

*** ActiveX Control Event ***
LPARAMETERS item

with item
	wait window nowait .Caption
endwith