[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Collapse]Application UI Manager
    [Expand]Widget View
    [Collapse]WindowsUI View
     [Collapse]Getting Started
       How To: Create a Message Box Flyout With User Control
       How To: Create a Modal Message Box Flyout
       How To: Create a Page Container
       How To: Create a PageGroup Container
       How To: Create a Pop-up Flyout
       How To: Create a SlideGroup Container
       How To: Create a SplitGroup Container
       How To: Create a TabbedGroup Container
       How To: Create a TileContainer
       How To: Pass Specific Data when Navigating Through Containers
       How To: Create Content Containers Hierarchy
      Content Containers
      Navigation Bars
      WindowsUI Buttons
      Search Panel
      Application Hierarchy and Module Navigation
     Tabbed View
     Native MDI View
     Document Selector
     Non-Document Mode
   [Expand]Deferred Load
   [Expand]Interaction with Dock Panels
   [Expand]Bar and Ribbon Merging
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How To: Create a Modal Message Box Flyout

This example demonstrates how to create a simple modal Windows8-like message box via a Flyout.

  1. Create a new WindowsUI View application, or open an existing one.
  2. Open the DocumentManager's context menu and run the Designer.
  3. Switch to the 'Elements' section and select 'Content Containers'. Click the 'Add New Container' button and choose 'Flyout' from the drop-down list.

  4. Select the newly created Flyout and change its name to closeAppFlyout via the property grid.
  5. Switch to the code view and create a FlyoutAction object that will display message text and buttons for the Flyout.

    Note that you can set the Flyout.FlyoutButtons property to OKCancel. In this case, you do not need to manually add the required buttons to the FlyoutAction.Commands collection.

  6. Optionally you can specify the background color for the solid bar that will display the message box. To do so, customize the Appearance section, which is accessed via the WindowsUIView.FlyoutProperties property.

  7. Associate the FlyoutAction with the Flyout via the Flyout.Action property.

  8. Now handle the main form's FormClosing event. Use the WindowsUIView.ShowFlyoutDialog method to call the Flyout. This method will freeze the form's thread, and show the Flyout in a separate thread. The ShowFlyoutDialog method returns a System.Windows.Forms.DialogResult value that indicates which button was clicked by the end-user. Depending on this value, you can allow or cancel form closing.

  9. Start your application and try to close the form. A modal message box Flyout will appear.

Is this topic helpful?​​​​​​​