/// <Summary> /// bind the RESPONSE event /// </Summary> This. listmenu. itemclicked + = new system. windows. forms. toolstripitemclickedeventhandler (this. listmenu_itemclicked ); /// <summary> /// right-click the itemmenu and choose </Summary> /// <Param name = "sender"> </param> // <Param name = "E"> </param> private void itemmenu_itemclicked (Object sender, toolstripitemclickedeventargs e) {// code ...}
However, itemmenu_itemclicked does not respond to the click events of level-2 menus, and does not want to add click events one by one. The following methods may help you:
Add the dropdownitemclicked event to the upper menu of the level-2 menu, for example:
This. copydetail. dropdownitemclicked + = new system. Windows. Forms. toolstripitemclickedeventhandler (copydetail_dropdownitemclicked );
Add a processing method as follows:
Void copydetail_dropdownitemclicked (Object sender, system. Windows. Forms. toolstripitemclickedeventargs e) {// code ...}
In this way, you can respond.
The same applies to multilevel menus.