Share
 
 

ShortCutMenuDisplay Property (ActiveX)

Controls whether right-clicking in the drawing area displays a shortcut menu or issues Enter.

Supported platforms: Windows only

Signature

VBA:

object.ShortCutMenuDisplay
object

Type: PreferencesUser

The object this property applies to.

Property Value

Read-only: No

Type: Boolean

  • True: Shortcut menus are enabled in the drawing area.
  • False: Shortcut menus are disabled in the drawing area. A right-click in the drawing area will be interpreted as an Enter.

Remarks

The initial value for this property is True.

When this property is set to True, you can customize the functionality of right-clicking in the drawing area using properties in the PreferencesUser object.

Note: The value of this property is stored in the SHORTCUTMENU system variable.

Examples

VBA:

Sub Example_ShortCutMenuDisplay()
    ' This example reads and toggles the preference value which controls
    ' whether right-clicking in the drawing area displays a shortcut menu
    ' or issues ENTER.
    
    Dim ACADPref As AcadPreferencesUser
    Dim originalValue As Variant, newValue As Variant
    Dim newAction As String
    
    ' Get the drafting preferences object
    Set ACADPref = ThisDrawing.Application.Preferences.User
    
    ' Read and display the original value
    originalValue = ACADPref.ShortCutMenuDisplay
    newAction = IIf(originalValue, "displays the shortcut menu", "sends an ENTER keystroke to ACAD")
    MsgBox "Right-clicking the mouse CURRENTLY " & newAction, vbInformation

    ' Modify the AutoSnapMarker preference by toggling the value
    ACADPref.ShortCutMenuDisplay = Not (originalValue)
    newValue = ACADPref.ShortCutMenuDisplay
    newAction = IIf(newValue, "display the shortcut menu", "send an ENTER keystroke to ACAD")
    MsgBox "Right-clicking the mouse over the drawing WILL NOW " & newAction, vbInformation
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ShortCutMenuDisplay()
    ;; This example reads and toggles the preference value which controls
    ;; whether right-clicking in the drawing area displays a shortcut menu
    ;; or issues ENTER.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-ShortCutMenuDisplay (vla-get-User preferences)))
    (setq newAction (if (= originalValue :vlax-true) "displays the shortcut menu" "sends an ENTER keystroke to ACAD"))
    (alert (strcat "Right-clicking the mouse CURRENTLY " newAction))
  
    ;; Modify the AutoSnapMarker preference by toggling the value
    (vla-put-ShortCutMenuDisplay (vla-get-User preferences) (if (= originalValue :vlax-true) :vlax-false :vlax-true))
    (setq newValue (vla-get-ShortCutMenuDisplay (vla-get-User preferences)))
    (setq newAction (if (= newValue :vlax-true) "displays the shortcut menu" "sends an ENTER keystroke to ACAD"))
    (alert (strcat "Right-clicking the mouse over the drawing WILL NOW " newAction))
)

Was this information helpful?