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

 TypeDescription 
   Item as Item An Item object being selected.  

Use the SelectItem event to notify your application that a new item is selected ( clicked ). The SelectItem event is fired when the user presses the ENTER key, and the ShowFocusRect property is True. The HighLightItem event occurs when the cursor hovers an item. 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 ExplorerBar1_SelectItem(ByVal Item As EXPLORERBARLibCtl.IItem)
    Debug.Print Item.Caption
End Sub

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

void OnSelectItemExplorerbar1(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 AxExplorerBar1_SelectItem(ByVal sender As Object, ByVal e As AxEXPLORERBARLib._IExplorerBarEvents_SelectItemEvent) Handles AxExplorerBar1.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 axExplorerBar1_SelectItem(object sender, AxEXPLORERBARLib._IExplorerBarEvents_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


 


Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.