ChangeMenu

Description

Changes the menu associated with a window.

Applies to

Window objects

Syntax

windowname.ChangeMenu ( menuname {, position } )

Argument

Description

windowname

The name of the window for which you want to change the menu.

menuname

The name of the menu you want to make the current menu.

position (PowerBuilder only)

For an MDI frame window, the number of the item on the menu bar to which you want to append the names of the open sheets. Items on the menu bar are numbered from the left, beginning with 1. The default is 0, which lists the open sheets on the menu bar’s next-to-last menu (or the last menu if there is only one available).

Returns

Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument’s value is null, ChangeMenu returns null. The return value is usually not used.

Examples

Example 1

This statement changes the top-level menu of the w_Employee window to m_Emp1:

w_Employee.ChangeMenu(m_Emp1)