on 09-10-2008 3:13 PM
Hi,
How do I add the UDT menu from Tools>User-Defined Windows to Main menu...C#
Thank you,
Rune
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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;
}
}
User | Count |
---|---|
97 | |
10 | |
9 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.