Skip to Content
0
Former Member
Jul 04, 2009 at 04:01 AM

Create Menus when Right_Click ?

111 Views

Help me ? I created menu when right click but now I want to create multiple Menu when right click then how can I do ?

.private void SBO_Application_RightClickEvent(ref SAPbouiCOM.ContextMenuInfo eventInfo, out bool BubbleEvent)
        {
            BubbleEvent = true;
            if (eventInfo.FormUID == "RightClk")
            {
                if (eventInfo.BeforeAction == true)
                {
                    SAPbouiCOM.MenuItem oMenuItem = null;
                    SAPbouiCOM.Menus oMenus = null;


                    try
                    {
                        SAPbouiCOM.MenuCreationParams oCreationPackage = null;
                        oCreationPackage = ((SAPbouiCOM.MenuCreationParams)(SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)));

                        oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING;
                        oCreationPackage.UniqueID = "OnlyOnRC";
                        oCreationPackage.String = "Only On Right Click";
                        oCreationPackage.Enabled = true;

                        oMenuItem = SBO_Application.Menus.Item("1280"); // Data'
                        oMenus = oMenuItem.SubMenus;
                        oMenus.AddEx(oCreationPackage);

                        // do I want to create  multi menu when right click ?
                        ........................
                       // wirte here ?

                    }
                    catch (Exception ex)
                    {
                        SBO_Application.SetStatusBarMessage(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, true);
                    } 
                }
            }
}..

thanks