Description
Defines the properties for new menu items.
With the Menus.AddEx method, you can use this object to do the following:
- Add and update application menus: To create or modify application menus, use the unique ID provided with each menu in the application. This ensures that your menu modifications are not affected by future versions.
- Add dynamic menu to your add-on forms: Using Form.Menu, you can add dynamic menus to your add-on forms. Dynamic menus appear under the Goto menu when the form gets focus.
Example
| Adding a dynamic menu (VB.NET) | Copy Code |
|---|
Dim oMenuItem As SAPbouiCOM.MenuItem
Dim oMenus As SAPbouiCOM.Menus
Dim oCreationPackage As SAPbouiCOM.MenuCreationParams
oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
oCreationPackage.Checked = False
oCreationPackage.Enabled = True
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
oCreationPackage.UniqueID = "MyFormMenu1"
oCreationPackage.String = "MyFormMenu1"
oForm.Menu.AddEx(oCreationPackage)
oCreationPackage.Checked = False
oCreationPackage.Enabled = True
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
oCreationPackage.UniqueID = "MyFormMenu2"
oCreationPackage.String = "MyFormMenu2"
oForm.Menu.AddEx(oCreationPackage) |
|
| Adding/updating application menus (VB.NET) | Copy Code |
|---|
Dim oMenuItem As SAPbouiCOM.MenuItem
Dim oMenus As SAPbouiCOM.Menus
Dim oCreationPackage As SAPbouiCOM.MenuCreationParams
oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
oMenuItem = SBO_Application.Menus.Item("43520") // moudles menu
oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP
oCreationPackage.UniqueID = "MyMenu01"
oCreationPackage.String = "Sample Menu"
oCreationPackage.Enabled = True
oCreationPackage.Image = "UI.bmp"
oCreationPackage.Position = 15
oMenus = oMenuItem.SubMenus
oMenus.AddEx(oCreationPackage) |
|
See Also