A form’s menu.

Syntax

[<oRef> =] new MenuBar(<parent> [, <name expC>])

<oRef>

A variable or property in which to store a reference to the newly created MenuBar object.

<parent>

The form (or the _app.frameWin object) to which you’re binding the MenuBar object.

<name expC>

An optional name for the MenuBar object. The Menu Designer always uses the name "root". If not specified, the MenuBar class will auto-generate a name for the object.

Properties

The following table lists the properties of the Menubar class.

Property

Default

Description

baseClassName

 

MENUBAR

 

Identifies the object as an instance of the MenuBar class.

className

(MENUBAR)

Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName

editCopyMenu

 

A menu item that copies selected text from a control to the Windows clipboard.

editCutMenu

 

A menu item that deletes selected text from a control and copies it to the Windows clipboard.

editPasteMenu

 

A menu item that pastes text from the Windows clipboard to the edit control with focus.

editUndoMenu

 

A menu item that restores the form to the state before the last edit operation was performed.

id

-1

A supplementary ID number for the object

name

 

The menubar object's name.

parent

 

An object reference that points to the parent form.

windowMenu

 

A top-level menu that lists open MDI windows.

 

Event

Parameters

Description

onInitMenu

 

When the menu is opened.

 

Method

Parameters

Description

release( )

 

Explicitly removes the menubar object from memory.

Description

A MenuBar object represents the top-level menu for a form. It contains one or more Menu objects which comprise the individual top-level menu items. The top-level menu of a form is displayed at the top of the form if the form’s mdi property is false, or in the MDI frame window if the form’s mdi property is true when the form has focus.

You may also designate a menubar that appears in the MDI frame when no MDI forms have focus by assigning a menubar to the _app.frameWin object.

The MenuBar object automatically binds itself to the <parent> form. Unlike other controls, you usually do not assign the resulting <oRef> as a property of the form, since this is done automatically, using the <name expC> that is specified. The Menu Designer always uses the name "root", so a form’s menu is referred to with the object reference:

form.root