New to Telerik UI for WinForms? Start a free 30-day trial

Alternates the expanded state assigned to a RadRibbonBar by successive command executions.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class ExpandCollapseCommand : CommandBase, IImageListProvider

Inheritance: objectCommandBaseExpandCollapseCommand

Implements: IImageListProvider

Constructors

C#
public ExpandCollapseCommand()

Methods

Determines whether the command accepts the specified target.

C#
public override bool CanExecute(object parameter)
Parameters:parameterobject

The candidate command target.

Returns:

bool

true for a Windows Forms control or a target accepted by the base command.

Overrides: CommandBase.CanExecute(object)

Applies the command's next expanded state to a ribbon bar.

C#
public override object Execute(params object[] settings)
Parameters:settingsobject[]

Command arguments; the first argument is used as the command target.

Returns:

object

Overrides: CommandBase.Execute(params object[])

The first execution targeting a RadRibbonBar sets Expanded to false; subsequent executions alternate the value. The command does not synchronize this toggle with changes made directly to the control's Expanded property.