Back to Devexpress

AccordionControl.IsPopupFormShown Property

windowsforms-devexpress-dot-xtrabars-dot-navigation-dot-accordioncontrol-1e4aeec1.md

latest3.7 KB
Original Source

AccordionControl.IsPopupFormShown Property

Gets or sets whether the pop-up form is shown.

Namespace : DevExpress.XtraBars.Navigation

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
public bool IsPopupFormShown { get; }
vb
<Browsable(False)>
Public ReadOnly Property IsPopupFormShown As Boolean

Property Value

TypeDescription
Boolean

true if the pop-up form is shown; otherwise, false.

|

Remarks

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

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.

csharp
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;
    }
}
vb
Imports DevExpress.XtraBars.Navigation

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

Private Sub accordionControl1_ElementClick(ByVal sender As Object, ByVal e As ElementClickEventArgs) _
    Handles accordionControl1.ElementClick
    Dim accordionControl As AccordionControl = TryCast(sender, AccordionControl)
    If e.MouseButton = MouseButtons.Left AndAlso accordionControl.IsPopupFormShown Then
        accordionControl.ClosePopupForm()
        e.Handled = True
    End If
End Sub

See Also

ClosePopupForm()

ShowPopupForm

AccordionControl Class

AccordionControl Members

DevExpress.XtraBars.Navigation Namespace