Type | Description | |||
ID as Long | A long expression that specifies the identifier of the item being clicked. |
The Click event is fired when the user clicks the item. Use the Select event to notify you application that the user selects an item. Use the RClick event to notify your application that user right clicked an item. Use the Item property to access an item giving its identifier. Use the Caption property to specify the caption of the item. Use the SelectOn property to specify whether the control selects an item if the user presses or releases the mouse button.
Syntax for Click event, /NET version, on:
private void Click(object sender,int ID) { } Private Sub Click(ByVal sender As System.Object,ByVal ID As Integer) Handles Click End Sub |
private void ClickEvent(object sender, AxEXMENULib._IMenuEvents_ClickEvent e) { } void OnClick(long ID) { } void __fastcall Click(TObject *Sender,long ID) { } procedure Click(ASender: TObject; ID : Integer); begin end; procedure ClickEvent(sender: System.Object; e: AxEXMENULib._IMenuEvents_ClickEvent); begin end; begin event Click(long ID) end event Click Private Sub ClickEvent(ByVal sender As System.Object, ByVal e As AxEXMENULib._IMenuEvents_ClickEvent) Handles ClickEvent End Sub Private Sub Click(ID As Long) End Sub Private Sub Click(ByVal ID As Long) End Sub LPARAMETERS ID PROCEDURE OnClick(oExMenu,ID) RETURN |
<SCRIPT EVENT="Click(ID)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function Click(ID) End Function </SCRIPT> Procedure OnComClick Integer llID Forward Send OnComClick llID End_Procedure METHOD OCX_Click(ID) CLASS MainDialog RETURN NIL void onEvent_Click(int _ID) { } function Click as v (ID as N) end function function nativeObject_Click(ID) return |
The following VB sample displays the caption of the item being clicked:
Private Sub ExMenu1_Click(ID As Long) Debug.Print ExMenu1.Item(ID).Caption End Sub
The following C++ sample displays the caption of the item being clicked:
#include "Item.h" void OnClickExmenu1(long ID) { OutputDebugString( m_menu.GetItem( COleVariant(ID) ).GetCaption() ); }
The following VB.NET sample displays the caption of the item being clicked:
Private Sub AxExMenu1_ClickEvent(ByVal sender As Object, ByVal e As AxEXMENULib._IMenuEvents_ClickEvent) Handles AxExMenu1.ClickEvent Debug.WriteLine(AxExMenu1.item(e.iD).Caption) End Sub
The following C# sample displays the caption of the item being clicked:
private void axExMenu1_ClickEvent(object sender, AxEXMENULib._IMenuEvents_ClickEvent e) { System.Diagnostics.Debug.WriteLine(axExMenu1[e.iD].Caption); }
The following VFP sample displays the caption of the item being clicked:
*** ActiveX Control Event *** LPARAMETERS id with thisform.ExMenu1 wait window nowait .Item(id).Caption endwith