Skip to Content
Former Member
Jul 15, 2005 at 12:30 PM

Problem with menu events


i'm creating a menu ,then , i create events like this :

Menu :

If oApplication.Menus.Exists("VidStore01") Then

Exit Sub

End If

Dim myPackage As SAPbouiCOM.MenuCreationParams

myPackage = oApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)

With myPackage

.Type = SAPbouiCOM.BoMenuType.mt_POPUP

.String = "Video Store"

.Enabled = True

.UniqueID = "VidStore01"

.Position = 100

.Checked = False

End With

Dim myMenuItem As SAPbouiCOM.MenuItem

Dim myMenus As SAPbouiCOM.Menus

myMenuItem = oApplication.Menus.Item("43520")

myMenus = myMenuItem.SubMenus

myMenuItem = myMenus.AddEx(myPackage)


With myMenuItem

.SubMenus.Add("Sub01", "Movies On shelf", SAPbouiCOM.BoMenuType.mt_STRING, 1)

.SubMenus.Add("Sub02", "Movies Location", SAPbouiCOM.BoMenuType.mt_STRING, 2)

.SubMenus.Add("Sub03", "Add Movie", SAPbouiCOM.BoMenuType.mt_STRING, 3)

.SubMenus.Add("Sub04", "Rent / Return Movie", SAPbouiCOM.BoMenuType.mt_STRING, 4)

End With

Catch ex As Exception


End Try

events :

Private Function set_filter() As SAPbouiCOM.EventFilters

Dim oFilter As SAPbouiCOM.EventFilter

set_filter = New SAPbouiCOM.EventFilters

oFilter = set_filter.Add(SAPbouiCOM.BoEventTypes.et_FORM_LOAD)

With oFilter


End With

oFilter = set_filter.Add(SAPbouiCOM.BoEventTypes.et_FORM_CLOSE)

With oFilter


End With

oFilter = set_filter.Add(SAPbouiCOM.BoEventTypes.et_MENU_CLICK)

With oFilter


End With

oFilter = set_filter.Add(SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED)

With oFilter


End With

oFilter = set_filter.Add(SAPbouiCOM.BoEventTypes.et_COMBO_SELECT)


End Function


It works only when i open the "EventSpy" , if i close it, no more events are catched .

someone have en idea ?