Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Work with multiple forms

Hi

I am develpoping an application in which in contains a folder a six form i am working with all at a time.

earlier i worked with single form.

now here are 6 forms now how to write

SBO_Application_MenuEvent

for the forms

how to write code for selecting add mode find modes can you get me any solution plz.

Thanks Regarding

mahi.

replied

Hi...

use this code....

Private Sub AddMenuItem()

Dim oMenuItem As SAPbouiCOM.MenuItem

Dim oMenus As SAPbouiCOM.Menus

Dim oCreationPackage As SAPbouiCOM.MenuCreationParams

Dim sPath As String

sPath = System.Windows.Forms.Application.StartupPath()

sPath = sPath.Remove(sPath.Length - 3, 3)

oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)

oMenuItem = SBO_Application.Menus.Item("43520")

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP

If SBO_Application.Menus.Exists("aaa") Then

SBO_Application.Menus.RemoveEx("aaa")

End If

oCreationPackage.UniqueID = "aaa"

oCreationPackage.String = "Module Name(Menu)"

oCreationPackage.Image = "C:\Program Files\SAP\SAP Business One\AddOns\Foldername\xxxx.bmp"

oCreationPackage.Enabled = True

oCreationPackage.Checked = True

oCreationPackage.Position = 14

oMenus = oMenuItem.SubMenus

Try

oMenus.AddEx(oCreationPackage)

oMenuItem = SBO_Application.Menus.Item("aaa")

oMenus = oMenuItem.SubMenus

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

oCreationPackage.UniqueID = "bbb"

oCreationPackage.String = " Form1"

oMenus.AddEx(oCreationPackage)

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

oCreationPackage.UniqueID = "ccc"

oCreationPackage.String = "Form2"

oMenus.AddEx(oCreationPackage)

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

oCreationPackage.UniqueID = "ddd"

oCreationPackage.String = "Form3"

oMenus.AddEx(oCreationPackage)

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

oCreationPackage.UniqueID = "eee"

oCreationPackage.String = "Form4"

oMenus.AddEx(oCreationPackage)

oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING

oCreationPackage.UniqueID = "ffff"

oCreationPackage.String = "form5"

oMenus.AddEx(oCreationPackage)

Catch er As Exception

SBO_Application.MessageBox("Menu Already Exists")

End Try

End Sub

Regards..

Billa 2007

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question