Export (0) Print
Expand All

Behavior.DisableAllCommands Property

Gets a value indicating whether MenuCommand objects should be disabled.

Namespace:  System.Windows.Forms.Design.Behavior
Assembly:  System.Design (in System.Design.dll)

public virtual bool DisableAllCommands { get; }

Property Value

Type: System.Boolean
true if all MenuCommand objects the designer receives should have states set to Enabled = false when this Behavior is active; otherwise, false.

A true value for the DisableAllCommands property indicates to the BehaviorService that all MenuCommand objects the designer receives should have their state disabled when this behavior is active.

The DisableAllCommands property works in conjunction with the FindCommand method so you can customize the interaction between glyphs and behaviors. The following table summarizes the results of a call to FindCommand for a particular MenuCommand.

DisableAllCommands is true

DisableAllCommands is false

Hit-tested glyph has an assigned behavior

If the MenuCommand with the specified command ID is found in the IMenuCommandService, that MenuCommand is disabled and returned. Otherwise, null is returned.

FindCommand is called on the behavior and, if found, the behavior’s MenuCommand is returned. Otherwise, the result of IMenuCommandService.FindCommand with the specified command ID is returned.

Hit-tested glyph has no assigned behavior

The result of IMenuCommandService.FindCommand with the specified command ID is returned.

The result of IMenuCommandService.FindCommand with the specified command ID is returned.

Notes to Inheritors

The default implementation always returns false.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2015 Microsoft