A container control that displays a stack of collapsible panes.
Namespace: MindFusion.Common.WinForms
Assembly: MindFusion.Common.WinForms
SyntaxC#
Copy Code
|
|---|
public class Accordion : FlowLayoutPanel |
Visual Basic
Copy Code
|
|---|
Public Class Accordion |
RemarksThe Accordion control organizes its child panels vertically and provides a flexible space-distribution model tailored for sidebars, toolbox panels, and palettes.
Accordion inherits directly from System.Windows.Forms.FlowLayoutPanel. Consequently, child panels are managed using standard WinForms collection patterns. You can add panels programmatically by instantiating an AccordionItem and calling Controls.Add on the parent Accordion. Individual panes are removed using Controls.Remove, and the entire container can be cleared using Controls.Clear.
C#
Copy Code
|
|---|
var item = new AccordionItem { Title = "Utilities", Icon = myFolderIcon }; |
Because Accordion is a vertical, non-wrapping FlowLayoutPanel, all items naturally align and stack tightly at the top of the container. If all panes are collapsed, they will cluster at the top of the viewport, leaving any remaining empty space at the bottom of the container.
The AccordionItem supports two sizing modes for its content:
By default, the Accordion allows multiple panes to be expanded concurrently. Setting the AllowMultipleExpands property to false enables single-expand mode, where expanding one pane automatically collapses all other panes in the control.
The expansion state of an individual pane can be programmatically queried or updated using the IsExpanded property on the AccordionItem. Any change to this state raises the IsExpandedChanged event, allowing listeners to react to visibility changes.
Inheritance HierarchySystem.Object![]()
System.MarshalByRefObject![]()
System.ComponentModel.Component![]()
System.Windows.Forms.Control![]()
System.Windows.Forms.ScrollableControl![]()
System.Windows.Forms.Panel![]()
System.Windows.Forms.FlowLayoutPanel![]()
MindFusion.Common.WinForms.Accordion
See Also