Skip to main content

EditorButtonCollection.Add(EditorButton) Method

Adds the specified button to the button collection.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual int Add(
    EditorButton button
)

Parameters

Name Type Description
button EditorButton

The EditorButton object specifying the button to insert into the collection.

Returns

Type Description
Int32

The zero-based index of the button within the collection.

Remarks

The Add method allows you to add a new button to the end of the current button collection. If the button already exists in the collection, the method does nothing.

The value returned by the Add method specifies the position of the new element or the position of the existing element in the collection.

To add a number of buttons to the collection at once, see the EditorButtonCollection.AddRange method.

The total number of buttons in the collection is specified by the Count property. The number of visible buttons is returned by the EditorButtonCollection.VisibleCount property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Add(EditorButton) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also