Back to Devexpress

AccordionControl.ForEachVisibleElement(Action<AccordionControlElement>) Method

windowsforms-devexpress-dot-xtrabars-dot-navigation-dot-accordioncontrol-dot-foreachvisibleelement-x28-system-dot-action-devexpress-dot-xtrabars-dot-navigation-dot-accordioncontrolelement-x29.md

latest3.7 KB
Original Source

AccordionControl.ForEachVisibleElement(Action<AccordionControlElement>) Method

Performs a certain action for each AccordionControl visible element.

Namespace : DevExpress.XtraBars.Navigation

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public void ForEachVisibleElement(
    Action<AccordionControlElement> handler
)
vb
Public Sub ForEachVisibleElement(
    handler As Action(Of AccordionControlElement)
)

Parameters

NameTypeDescription
handlerAction<AccordionControlElement>

An action to perform against each visible element.

|

Remarks

The ForEachVisibleElement method iterates through visible elements and invokes the specified action for them. The following elements are regarded as invisible:

The following code shows how you can perform an action on visible elements:

csharp
accordionControl1.ForEachVisibleElement((el) => {
    //Do some action
    //Toggle visibility for Items
    if (el.Style == DevExpress.XtraBars.Navigation.ElementStyle.Item) {
        el.Visible = !el.Visible;
    }
});
vb
AccordionControl1.ForEachVisibleElement(Sub(el)
                                     'Do some action
                                     'Toggle visibility for Items
                                     If el.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item Then
                                         el.Visible = Not el.Visible
                                     End If
                                 End Sub)

See Also

AccordionControl.Elements

AccordionControlElement.Elements

GetElements()

GetVisibleElements()

ForEachElement(Action<AccordionControlElement>)

IsVisible

Level

AccordionControl Class

AccordionControl Members

DevExpress.XtraBars.Navigation Namespace