cancel
Showing results for 
Search instead for 
Did you mean: 

Customize MenuEvent

Former Member
0 Kudos

Hi,

How can we control the MenuEvent on UDO form only? I wish to run additional procedures when Navigation/Find/Add menus are clicked.

E.g. When I click the Find menu, I want a textbox to get focus.

Automanged=True and SupportedModes=-1 are setup.

I am using VB. Help appreciated.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Sorry, I run too much. MenuEvent!= ItemEvent.

Regards,

Ibai Peñ

Former Member
0 Kudos

Hi there...

Ibai, filters only apply to item events, not for application or menuevents. So you don't have to capture it...

CK, for your question, you could do something like below...

<b>Code (C#)</b>

// The function called when a menuevent occurs
private void SBO_Application_MenuEvent(ref SAPbouiCOM.MenuEvent pVal, out bool BubblesEvent) 
{
  // Check if the active form is the form where yoyu want to catch the events
  if(SBO_Application.Forms.ActiveForm.UniqueID == "MyFormUID")
  {
    // Now determine if there is a menuuid that you need... :)
    switch(pVal.MenuUID)
    {
      case NAVIGATION_MENU_UID:
        // Do something...
        break;
      case FIND_MENU_UID:
        // Do something...
        break;
      case ADD_MENU_UID:
        // Do something...
        break;
    }
  }
}

Hope it helps...

Former Member
0 Kudos

Sounds familiar, some problem here sometimes...

Grtz!

Sorry, I run too much. MenuEvent!= ItemEvent.

Regards,

Ibai Peñ

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi R. Schwachofer

You've solved my problem. Thanks!

Former Member
0 Kudos

Glad to help...

Greetz, Rowdy

Former Member
0 Kudos

I'll try it out shortly. Thank you, guys!