Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

AccordionControl.ClosePopupForm() Method

Closes the pop-up form.

Namespace: DevExpress.XtraBars.Navigation

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public void ClosePopupForm()

#Remarks

If the control is minimized (see AccordionControl.OptionsMinimizing.State), it displays a pop-up form when the user clicks an element.

image

You can use the AccordionControl.OptionsMinimizing.PopupFormAutoHeightMode property to specify how the control calculates the form height.

To open the pop-up form in code, call the ShowPopupForm method. For instance, you can open the form when the mouse pointer hovers an item. To check if the form is already displayed, use the IsPopupFormShown property. To close the form, call the ClosePopupForm() method.

#Example

The code below shows how to close the pop-up form when the user clicks an item.

using DevExpress.XtraBars.Navigation;

accordionControl1.OptionsHamburgerMenu.DisplayMode = AccordionControlDisplayMode.Inline;
accordionControl1.ViewType = AccordionControlViewType.HamburgerMenu;

private void accordionControl1_ElementClick(object sender, DevExpress.XtraBars.Navigation.ElementClickEventArgs e) {
    AccordionControl accordionControl = sender as AccordionControl;
    if (e.MouseButton == MouseButtons.Left && accordionControl.IsPopupFormShown) {
        accordionControl.ClosePopupForm();
        e.Handled = true;
    }
}
See Also