ToolBarButton.Menu

Syntax

Menu: PP.Ui.Menu

Description

The Menu menu sets child menu for component.

Example

To execute the example, the HTML page must contain the ToolBar component named toolBar and the ImageList component that refers to the ui-icons_222222_256x240.png file containing a collection of icons (see Example of Creating the ToolBar Component).

//Create the Menu component: child menu for the button

        var menu = new PP.Ui.Menu();

        menu.addItem(new PP.Ui.MenuItem({ Content: "Tahoma"}));

        menu.addItem(new PP.Ui.MenuItem({ Content: "Times New Roman"}));

        menu.addItem(new PP.Ui.MenuItem({ Content: "Calibri"}));

        menu.addItem(new PP.Ui.MenuItem({ Content: "Verdana"}));

//Create a button that contains child menu

        var fontsButton = new PP.Ui.ToolBarButton({

            Content: "Font",

            ToolTip: "Select font",

            IsFlat: false,

            Parent: toolBar,

            Menu: menu

        });

//Add the menu button:

        toolBar.addItem(fontsButton);

After executing the example a button that contains a drop-down menu is placed to the HTML page:

See also:

ToolBarButton