Help / WLanguage / WLanguage functions / Controls, pages and windows / Menu functions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Adds a new menu to an existing drop-down or context menu of a window or page. This new menu can contain:
To insert a menu at a specific location, use <Menu>.InsertMenu.
// Adds a new menu to MENU_MyMenu
MENU_MyMenu.AddMenu("OPT_Schedule", "Schedule")
// Adds an option to the new OPT_Schedule menu
OPT_Schedule.AddOption("OPT_Create", "Create", Create_Schedule)
// Associates an image with the OPT_Create menu option
{"OPT_Create", indControl}..Image = "schedule.png"
// Add a separator
// Adds a new option (OPT_View)
OPT_Schedule.AddOption("OPT_View", "View", View_schedule)

Adding a menu Hide the details

<Result> = <Source menu>.AddMenu(<Menu to create> , <Caption>)
<Result>: Integer
Position of the menu. If the menu is not added, a fatal error occurs.
<Source menu>: Menu name
Name of the drop-down or context menu to which the new menu should be added. The name of the menu corresponds to:
  • WINDEV the name of the main menu in the window. The new menu will be added after the options of the main menu.
  • the name of a context menu. The new menu will be added after the options of the context menu.
  • the name of a menu option. This option will then be transformed into a menu.
PHP Remarks: Context menus are not available.
<Menu to create>: Character string
Name of the menu to be added. This name will be used to programmatically handle the menu. A fatal error occurs if this name corresponds to an existing menu.
<Caption>: Character string
Text of the new menu. This text will be displayed in the window or page.
Component: wd280obj.dll
Minimum version required
  • Version 23
This page is also available for…
Click [Add] to post a comment

Last update: 06/19/2023

Send a report | Local help