In This Article

BarButtonLink Class

Represents a bar button command link.

public class BarButtonLink : BarCommandLink, IInputElement, IUIElement, ILogicalTreeNode, IDisposable, IImageListProvider
Inheritance:
Object MarshalByRefObject DisposableObject LogicalTreeNodeBase UIElement BarCommandLink Object
Implements:
IInputElement IUIElement ILogicalTreeNode IDisposable IImageListProvider

Constructors

Initializes a new instance of the BarButtonLink class, based on an existing BarButtonCommand.

public BarButtonLink(BarButtonCommand command)
Parameter Type Description
command BarButtonCommand

The BarCommand upon which the link is based.

Initializes a new instance of the BarButtonLink class, for use in a programmatically created popup menu.

public BarButtonLink(string category, string name, string text, int imageIndex, bool enabled, bool checkable, bool isChecked, bool beginAGroup)
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 Int32

The index of an image within an ImageList.

enabled Boolean

Whether the button is enabled.

checkable Boolean

Whether the button is checkable.

isChecked Boolean

Whether the button is currently checked.

beginAGroup Boolean

Whether to begin a group.

Properties

Gets the BarButtonCommand to link to.

public BarButtonCommand Command { get; }

Property Value

BarButtonCommand:

The BarButtonCommand to link to.

Methods

Gets the UIElementDrawState for the element.

public UIElementDrawState GetDrawState()

Returns

UIElementDrawState:

The UIElementDrawState for the element.

Remarks

The default implementation of this method returns UIElementDrawState.None.

Raises the MouseDown event.

protected override void OnMouseDown(MouseEventArgs e)
Parameter Type Description
e MouseEventArgs

A MouseEventArgs that contains the event data.

Raises the MouseUp event.

protected override void OnMouseUp(MouseEventArgs e)
Parameter Type Description
e MouseEventArgs

A MouseEventArgs that contains the event data.

Renders the element.

protected override void OnRender(PaintEventArgs e)
Parameter Type Description
e PaintEventArgs

A PaintEventArgs that contains the event data.

Inherited Members