PopupMenu PopupMenu PopupMenu PopupMenu PopupMenu Constructor


Creates a new instance of the PopupMenu class.

public : PopupMenu()
PopupMenu() const;
public PopupMenu()
Public Sub New()
var popupMenu = new popupMenu();


To customize the context menu, call preventDefault on the oncontextmenu event (e in the example) to suppress the default context menu, and then create a new, empty context menu as shown in the Context menu sample.

e.preventDefault(); // Prevent the default context menu.
var menu = new Windows.UI.Popups.PopupMenu();


You can see complete code examples that demonstrate how to create and customize context menu in the Context menu sample on the sample home page.

To use this object from a desktop app, create the object, and then use the IInitializeWithWindow::Initialize method to associate the object with a window handle.

See also