In This Article

BarComboBoxCommand Class

Represents a bar combobox command.

public class BarComboBoxCommand : BarCustomControlCommand, IImageListProvider, IBarClickableCommand
Inheritance:
object Command BarCommand BarCustomControlCommand object
Implements:
IImageListProvider IBarClickableCommand

Constructors

BarComboBoxCommand(string, string, string?, int)

Initializes an instance of the class.

public BarComboBoxCommand(string category, string name, string? text = null, int imageIndex = -1)
Parameter Type Description
category string

The category of the bar command.

name string

The name of the bar command.

text string

The text caption.

imageIndex int

The index of an image within an ImageList.

Properties

ControlValue

The string value of the custom control.

public override string? ControlValue { get; set; }

Property Value

string

DropDownWidth

The width of the ComboBox drop-down.

public int DropDownWidth { get; set; }

Property Value

int:

A value of -1, the default, makes the drop-down the same size as the ComboBox link.

Items

The collection of items for the combobox.

public BarComboBoxCommand.ObjectCollection Items { get; }

Property Value

BarComboBoxCommand.ObjectCollection

SelectedIndex

The selected index of the ComboBox drop-down.

public int SelectedIndex { get; set; }

Property Value

int

SelectedItem

The selected item in the Items collection.

[Browsable(false)]
public object? SelectedItem { get; }

Property Value

object

Style

The style of the combobox.

public BarComboBoxCommandStyle Style { get; set; }

Property Value

BarComboBoxCommandStyle

Methods

CloneToType(Type)

Creates a copy of the BarCommand.

protected override BarCommand CloneToType(Type targetType)
Parameter Type Description
targetType Type

The target Type.

Returns

BarCommand:

The copy of the BarCommand.

Creates a new BarCommandLink for the command.

public override BarCommandLink CreateCommandLink()

Returns

BarCommandLink

OnClick(BarCommandLinkEventArgs)

Raises the Click event.

protected virtual void OnClick(BarCommandLinkEventArgs e)
Parameter Type Description
e BarCommandLinkEventArgs

The event data.

OnSelectedIndexChanged(EventArgs)

Raises the SelectedIndexChanged event.

protected virtual void OnSelectedIndexChanged(EventArgs e)
Parameter Type Description
e EventArgs

The event data.

OnStyleChanged(EventArgs)

Raises the StyleChanged event.

protected virtual void OnStyleChanged(EventArgs e)
Parameter Type Description
e EventArgs

The event data.

ReadAttributesFromXml(BarLayoutXmlSerializer)

Deserializes the attribute data for the BarCommandLink from XML.

protected override void ReadAttributesFromXml(BarLayoutXmlSerializer serializer)
Parameter Type Description
serializer BarLayoutXmlSerializer

The BarLayoutXmlSerializer to use.

ReadElementFromXml(BarLayoutXmlSerializer)

Deserializes a child element for the BarCommandLink from XML.

protected override void ReadElementFromXml(BarLayoutXmlSerializer serializer)
Parameter Type Description
serializer BarLayoutXmlSerializer

The BarLayoutXmlSerializer to use.

ResetCanCustomizeKeyboardShortcuts()

Resets the CanCustomizeKeyboardShortcuts property to its default value.

public override void ResetCanCustomizeKeyboardShortcuts()

ResetDropDownWidth()

Resets the DropDownWidth property to its default value.

public virtual void ResetDropDownWidth()

ResetSelectedIndex()

Resets the SelectedIndex property to its default value.

public virtual void ResetSelectedIndex()

ResetStyle()

Resets the Style property to its default value.

public virtual void ResetStyle()

ShouldSerializeCanCustomizeKeyboardShortcuts()

Indicates whether the CanCustomizeKeyboardShortcuts property should be persisted.

public override bool ShouldSerializeCanCustomizeKeyboardShortcuts()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeDropDownWidth()

Indicates whether the DropDownWidth property should be persisted.

public virtual bool ShouldSerializeDropDownWidth()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeSelectedIndex()

Indicates whether the SelectedIndex property should be persisted.

public virtual bool ShouldSerializeSelectedIndex()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeStyle()

Indicates whether the Style property should be persisted.

public virtual bool ShouldSerializeStyle()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

WriteAttributesToXml(BarLayoutXmlSerializer)

Serializes the attribute data for the BarCommand to XML.

protected override void WriteAttributesToXml(BarLayoutXmlSerializer serializer)
Parameter Type Description
serializer BarLayoutXmlSerializer

The BarLayoutXmlSerializer to use.

WriteElementsToXml(BarLayoutXmlSerializer)

Serializes the child element data for the BarCommand to XML.

protected override void WriteElementsToXml(BarLayoutXmlSerializer serializer)
Parameter Type Description
serializer BarLayoutXmlSerializer

The BarLayoutXmlSerializer to use.

Events

Click

Occurs when a BarCommand is clicked.

public event BarCommandLinkEventHandler? Click

Event Type

BarCommandLinkEventHandler

SelectedIndexChanged

Occurs when the SelectedIndex property is changed.

public event EventHandler? SelectedIndexChanged

Event Type

EventHandler

StyleChanged

Occurs when the Style property is changed.

public event EventHandler? StyleChanged

Event Type

EventHandler

Inherited Members

Extension Methods