Menus.NewPopupMenu

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From Menus.pas

	function NewPopupMenu(Owner: TComponent;
		const AName: string;
		Alignment: TPopupAlignment;
		AutoPopup: Boolean;
		const Items: array of TMenuItem): TPopupMenu;


Unit: Menus

Type: function

Visibility: public

C++ Information

From Menus.hpp

	Menus::TPopupMenu * __fastcall NewPopupMenu(Classes::TComponent * Owner,
		System::UnicodeString AName,
		Menus::TPopupAlignment Alignment,
		bool AutoPopup,
		Menus::TMenuItem * const * Items,
		int Items_Size);


Unit: Menus

Type: function

Description

Creates and initializes a popup menu.


Call NewPopupMenu to create and initialize a popup menu programmatically. NewPopupMenu returns the TPopupMenu component that represents the popup menu, but does not associate that popup menu with any control.

The Owner parameter specifies the component that is responsible for freeing the menu.

The AName parameter specifies the name of the popup menu, which is used to refer to it in code.

The Alignment parameter determines where the menu appears relative to the mouse when the user right clicks on the control that uses the menu.

The AutoPopup parameter specifies whether the menu should appear automatically when the user right clicks the associated control.

The Items parameter is an array of menu items that make up the top level menu items. To create the menu items for the Items parameter, use the NewItem function.

Note:  The Items_Size parameter specifies the index of the last menu item in Items (one less than the number of menu items).

See Also

Personal tools
Translations
Newest Version