cancel
Showing results for 
Search instead for 
Did you mean: 

UDT to the Main Menu

Former Member
0 Kudos

Hi,

How do I add the UDT menu from Tools>User-Defined Windows to Main menu...C#

Thank you,

Rune

Accepted Solutions (1)

Accepted Solutions (1)

Nussi
Active Contributor
0 Kudos

Hi Rune,

1. you have to catch the MenuEvent handler for this

if pval.MenuUID = "YourMenuUID" and pval.beforeaction = false then

2. implement this code there (i used this in sbo 2005)

the trick is to catch the Tools / Usertables menu and go through all entries with comparing the name


        Set oMenu = oSBO.appl.Menus.item("51200")
        For i = 0 To oMenu.SubMenus.count - 1
           If oMenu.SubMenus.item(i).String = "B1C_JOKB - Journal Karriere - Bonus" Then
            MenuUID = oMenu.SubMenus.item(i).UID
           End If
        Next
        oSBO.appl.ActivateMenuItem (MenuUID)

3. and this time it's in vb6 - it's old code but you can convert it and ask me

lg David

Former Member
0 Kudos

Thanks David!

I works fine!

Here is the C# Code...

// Add UDT Menu to Main Menu

                            oMenus = SBO_Application.Menus;
                            oMenuItem = SBO_Application.Menus.Item( "51200" );
                            int iCounter_Stop_int = oMenuItem.SubMenus.Count;

                            for ( int iCounter = 0; iCounter < iCounter_Stop_int; iCounter++ )
                            {
                                   if ( oMenuItem.SubMenus.Item( iCounter ).String == "My UDT Text" )
                                   {
                                          string UDT_Menu_UID = oMenuItem.SubMenus.Item( iCounter ).UID;

                                          break;
                                   }
                            }

Answers (0)