ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Menu functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
MenuInsertOption (Function)
In french: MenuInsèreOption
Inserts a new option at a specific position. This menu option executes a procedure passed as a parameter.
To add a menu option at the end of a menu, use MenuAddOption.
Example
// Insert an option into the new menu
MenuInsertOption("MNU_Schedule", "MNU_Consult", "MNU_Create", "Create", Create_Schedule)
// Associate an image with the menu option
{"MNU_Create", indControl}..Image = "See.png"
Syntax

Inserting a menu option (position defined by a menu option) Hide the details

<Result> = MenuInsertOption(<Source menu> , <Insertion option> , <Option to create> , <Caption> , <WLanguage procedure> [, <Procedure parameter>])
<Result>: Integer
Position of the option in the menu. A fatal error occurs if the menu option was not inserted.
<Source menu>: Menu name
Name of the menu where the menu option must be created and added. The option will be added at the end of this menu.
<Insertion option>: Character string
Name of the menu option used as base position for the insertion. The new menu option will be inserted before this position.
<Option to create>: Character string
Name of the menu option to create and to insert. This name will be used to programmatically handle the menu option. If there is an option with the same name, a fatal error occurs.
<Caption>: Character string
Text of the new menu option. This text will be displayed in the window and will allow users to select the option.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure called when the menu option is selected.
<Procedure parameter>: Optional variant
Parameter that can be passed to <WLanguage procedure> when the menu option is selected by the user.

Inserting a menu option (position defined by a subscript) Hide the details

<Result> = MenuInsertOption(<Source menu> , <Insertion position> , <Option to create> , <Caption> , <WLanguage procedure> [, <Procedure parameter>])
<Result>: Integer
Position of the option in the menu. A fatal error occurs if the menu option was not inserted.
<Source menu>: Menu name
Name of the menu where the menu option must be created and inserted. The option will be added at the end of this menu.
<Insertion position>: Integer
Index of the menu option used as reference position to insert the new element. The new menu option will be inserted before this position.
<Option to create>: Character string
Name of the menu option to create and to insert. This name will be used to programmatically handle the menu option. If there is an option with the same name, a fatal error occurs.
<Caption>: Character string
Text of the new menu option. This text will be displayed in the window and will allow users to select the option.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure called when the menu option is selected.
<Procedure parameter>: Optional variant
Parameter that can be passed to <WLanguage procedure> when the menu option is selected by the user.
Remarks
To associate an image with a menu option, use the Image property.
Component: wd300obj.dll
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/30/2025

Send a report | Local help