KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Removing a Menu from the Menu bar
PRODUCT: 4D | VERSION: 15.2 | PLATFORM: Mac & Win
Published On: August 4, 2016

The following method can remove a Menu from the Menu bar:

// --------------------------------------------------------------------------------
// Name: REMOVE_MENU_FROM_MENU_BAR
// Description: Method will remove a menu from the Menu bar in the current process.
//
// Input:
// $1 (LONGINT) - Menu bar reference
// $2 (LONGINT) - Menu to remove
// --------------------------------------------------------------------------------
C_LONGINT($1;$menu)
C_LONGINT($2;$menuItem)
C_TEXT($menuRef)

If (Count parameters=2)
   $menu:=$1
   $menuItem:=$2

   SET MENU BAR($menu)
   $menuRef:=Get menu bar reference(Current process)
   DELETE MENU ITEM($menuRef;$menuItem)
End if


Here is an example of a menu bar:




Method REMOVE_MENU_FROM_MENU_BAR to remove "View":

REMOVE_MENU_FROM_MENU_BAR (3;3) // 3 - Menu Bar #3, 3 - Menu "View"


Menu bar without "View":