![]() | Type | Description | ||
| 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.
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