Example

Display a PopUp Menu.


Display a PopUp Menu code snippet.

The following is a simple example of how to display a Popup Menu on a grid control.  The code snippet assumes you have created a menu named "muEdit" in a Form and a DGrid control named "DGrid1" is sited on the form.


Private Sub DGrid1_RButtonDown(ByVal Row As Long, ByVal Col As Long, ByVal x As Long, ByVal y As Long)
    'simply display the PopUp Menu at the current
    'position of the cursor.
    'use the x and y variables to position the menu
    PopupMenu muEdit
End Sub