Skip to main content
Bar

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

PopupControlContainer.BeforePopup Event

Fires when the pop-up is about to be displayed and allows you to adjust its settings (e.g., size), or cancel the action.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DXCategory("Events")]
public event CancelEventHandler BeforePopup

#Event Data

The BeforePopup event's data class is CancelEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled.

#Remarks

To display the pop-up, call the PopupControlContainer.ShowPopup method. Before the pop-up is shown, the BeforePopup event fires. Within the event handler, you can adjust pop-up settings (e.g., size), or prohibit displaying the pop-up.

private void popupControlContainer1_BeforePopup(object sender, EventArgs e) {
    PopupControlContainer popup = (PopupControlContainer)sender;
    if (popup != null) {
        popup.Width = 500;
        popup.Height = 500;
    }
    //You can also prohibit to show the pop-up.
    //e.Cancel = true;
}
See Also