Skip to Content
0
Former Member
Dec 19, 2005 at 03:08 PM

C# -- Problem to Catch MenuEvent

268 Views

Hi all,

The Menu Event it does not come intercepted

This is the Menu that I've insert

menuItem =  this.appl.Menus.Item("43520");
mnuPkg.Type = SAPbouiCOM.BoMenuType.mt_POPUP;
mnuPkg.String	= "Add-in";	
mnuPkg.UniqueID = "D3F_AINSCO";
mnuPkg.Enabled	= true;
mnuPkg.Position = menus.Count;
menus = menuItem.SubMenus;
menus.AddEx(mnuPkg);
			
menuItem = menus.Item("D3F_AINSCO");
mnuPkg.Type= SAPbouiCOM.BoMenuType.mt_STRING;
mnuPkg.String	= "Manage";
mnuPkg.Enabled	= true;
mnuPkg.Position = menus.Count;
mnuPkg.UniqueID = "D3F_MNT";
menus = menuItem.SubMenus;
menus.AddEx ( mnuPkg );

This is an Event Filter


evnt = evnts.Add(SAPbouiCOM.BoEventTypes.et_MENU_CLICK);
evnt.AddEx("D3F_MNT");
		

This is the Handle Event code

private void appl_MenuEvent(ref SAPbouiCOM.MenuEvent pVal, out bool BubbleEvent)
{
BubbleEvent = true;

 if ( pVal.BeforeAction == true)
 {
   switch(pVal.MenuUID)
   {
     case "D3F_MNT":
          this.LoadFormFromXml(   stPath + "\Gst.srf");
          break;
   }
 }
}

When I press on menu the form doesn't loaded.. and In the MenuEvent never it enter

where is my error??

Bye!!!