Skip to main content
.NET 8.0+

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

View.CanClose() Method

Determines whether a View can be closed.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

public bool CanClose()

#Returns

Type Description
Boolean

true if the current View can be closed; otherwise, false.

#Remarks

Use this method to check whether a View is allowed to be closed. If the current View is not root (it is created in another View’s Object Space), this method returns true. Otherwise, it raises the View.QueryCanClose event and returns the opposite value of the handler’s CancelEventArgs.Cancel parameter. Handle this event to prohibit closing a View under specific conditions.

This method is used internally, when closing a Window in a Windows Forms application and when replacing a View with another.

See Also