Back to Devexpress

PopupMenu.ShowPopup(Point) Method

windowsforms-devexpress-dot-xtrabars-dot-popupmenu-dot-showpopup-x28-system-dot-drawing-dot-point-x29.md

latest3.0 KB
Original Source

PopupMenu.ShowPopup(Point) Method

Displays the current PopupMenu at the specified screen point.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public override void ShowPopup(
    Point p
)
vb
Public Overrides Sub ShowPopup(
    p As Point
)

Parameters

NameTypeDescription
pPoint

A screen point at which the current PopupMenu is displayed.

|

Remarks

The specified Point coordinates must be in pixels.

You can display a RibbonMiniToolbar and a popup menu simultaneously. First, assign a popup menu to a toolbar via the RibbonMiniToolbar.PopupMenu property, or assign a toolbar to a popup menu via the PopupMenu.RibbonToolbar property. Then, call the RibbonMiniToolbar.Show or the PopupMenu.ShowPopup method.

Example

The following code displays a specific PopupMenu if the right mouse button is pressed:

csharp
private void Form1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) {
    if(e.Button == MouseButtons.Right)
        popupMenu1.ShowPopup(Control.MousePosition);
}
vb
Private Sub Form1_MouseUp(ByVal sender As Object, _
  ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseUp
    If e.Button = MouseButtons.Right Then
        PopupMenu1.ShowPopup(Control.MousePosition)
    End If
End Sub

See Also

ShowPopup

Show(Point)

RibbonToolbar

RibbonMiniToolbar.PopupMenu

XtraBars.PopupMenu

RibbonMiniToolbar

PopupMenu Class

PopupMenu Members

DevExpress.XtraBars Namespace