Skip to Content
0
Former Member
Feb 06, 2012 at 05:35 PM

Problem with button event

14 Views

hi everybody, i'm trying to catch a button event and show a message box after i click the button

here is the code of the button

oItem = oForm.Items.Add("12", SAPbouiCOM.BoFormItemTypes.it_BUTTON)

oItem.Left = 6

oItem.Width = 65

oItem.Top = 51

oItem.Height = 19

oButton = oItem.Specific

oButton.Caption = "Ok"

so the UID is 12

and here is the code for handling the event

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

If (pVal.Before_Action = True) Then

If (pVal.ItemUID = "12") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then

SBO_Application.MessageBox("mensaje")

End If

End If

End Sub

but it doesn't work 😔 no message box appear when i click the button can you please help me with this? it may be easy for you guys