Fires before a context menu is opened.
object_ContextMenuOpen(sourceObject As Object,
menuType As ContextMenuTypes,
Cancel As Boolean)
The ContextMenuOpen event syntax has the following parts:
Part | Description |
---|---|
sourceObject | Object - A reference to the object that is opening the menu. |
menuType | ContextMenuTypes - Specifies the type of menu that will be opened for this sourceObject. |
Cancel | Boolean - determines whether the default menu handler should be cancelled. This parameter should be set to True to disable or replace built in context menus. |
The settings for menuType are:
Setting | Description |
---|---|
ddCMSection | 0 - Section context menu. |
ddCMControl | 1 - Control context menu. |
ddCMReport | 2 - Report object context menu. |
ddCMRTFEditMode | 3 - RichEdit context menu. |
'Example implementation of the ContextMenuOpen event
'The mnuReport, mnuControl, mnuSection and mnuRichEdit
'are menu items created using VB's Menu editor
'You can use the sourceObject properties to enable/disable
'your custom menu options
Private Sub ARDesigner1_ContextMenuOpen(ByVal sourceObject As Object, ByVal menuType As DDActiveReportsDesignerCtl.ContextMenuTypes, Cancel As Boolean)
Select Case menuType
Case ddCMControl
PopupMenu mnuControl
Case ddCMReport
PopupMenu mnuReport
Case ddCMSection
PopupMenu mnuSection
Case ddCMRichedit
PopupMenu mnuRichEdit
End Select
Cancel = True
End Sub