event Select (ID as Long)
Occurs when an item is selected by clicking or by pressing RETURN key.

 TypeDescription 
   ID as Long A long expression that indicates the item's identifier.  

Use the Select event to notify your application that a new item was selected. Use the Item property to retrieve the item giving its identifier. Use the SelectOn property to specify whether the control selects an item if the user presses or releases the mouse button. Use the Caption property to specify the caption of the item.

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

Private Sub ExMenu1_Select(ByVal ID As Long)
    ' The user has selected an item
    Debug.Print "You have selected '" & ExMenu1(ID).Caption & "'"
End Sub

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

<SCRIPT FOR="ExMenu1" EVENT="Select(id)" LANGUAGE="javascript">
 
 obj = document.getElementById ( "ExMenu1" );
 window.alert(obj.Item(id).Caption);
 
</SCRIPT>

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

void OnSelectExmenu1(long ID) 
{
	OutputDebugString( m_menu.GetItem( COleVariant(ID) ).GetCaption() );
}

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

Private Sub AxExMenu1_SelectEvent(ByVal sender As System.Object, ByVal e As AxEXMENULib._IMenuEvents_SelectEvent) Handles AxExMenu1.SelectEvent
    Debug.WriteLine(AxExMenu1.item(e.iD).Caption)
End Sub

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

private void axExMenu1_SelectEvent(object sender, AxEXMENULib._IMenuEvents_SelectEvent e)
{
	System.Diagnostics.Debug.WriteLine(axExMenu1[e.iD].Caption);
}

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

*** ActiveX Control Event ***
LPARAMETERS id

with thisform.ExMenu1.Item(id)
	wait window nowait .Caption
endwith

 


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