Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Expand]Concepts
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Collapse]Task-Based Help
  [Expand]Business Model Design
  [Expand]Application Model
  [Expand]Actions
  [Expand]Navigation
  [Expand]Views
  [Expand]List Editors
  [Expand]Property Editors
  [Expand]Templates
  [Expand]Filtering
  [Expand]Reporting
  [Expand]Dashboards
  [Expand]Scheduler and Notifications
  [Expand]Maps
  [Expand]Security
  [Expand]Workflow
  [Expand]Localization
  [Expand]Testing
  [Collapse]Miscellaneous UI Customizations
    How to: Add a button to a Form using Custom View Item
    How to: Adjust the Size and Style of Pop-up Dialogs (ASP.NET)
    How to: Adjust the Windows' Size and Style
    How to: Change an Application Logo and Info
    How to: Create a Custom Control Detail Item
    How to: Customize a Window Caption
    How to: Customize ASP.NET Layout Elements Using Custom CSS Classes
    How to: Customize Export Options of the Printing System
    How to: Customize the Conditional Appearance Module Behavior
    How to: Customize Window Status Messages
    How to: Enable High DPI Support in a WinForms Application
    How to: Implement a Custom Messaging Class
    How to: Include an Action to a Detail View Layout
    How to: Set Images and Captions for Enumeration Values
    How to: Show a Custom Confirmation Window
    How to: Show a Custom Window with an Embedded XAF View
    How to: Show a Custom Windows Form
    How to: Use a Custom Splash Screen
    How to: Use Custom Themes in ASP.NET Applications
 [Expand]Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
[Expand]End-User Documentation

How to: Adjust the Windows' Size and Style

In WinForms XAF applications, end-users can drag the size grip in the bottom-right corner to resize windows. You can also customize the initial size in code. This topic describes how to programmatically resize and customize windows depending on the displayed View. Pop-up dialog windows are used as an example.

Show Me

The complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E4208.

Tip

A similar example for ASP.NET is available in the How to: Adjust the Size and Style of Pop-up Dialogs (ASP.NET) topic.

Expanded Set the Default Size and Style of Pop-up Windows

Popup windows can be customized in the XafApplication.CustomizeTemplate and Frame.TemplateChanged events. Create a new Window Controller and subscribe to either of these events when the Controller is activated (Controller.Activated event) as shown below.

In this code, the target window template is accessed by subscribing to the TemplateChanged event from a Controller. Then, handle the ISupportStoreSettings.SettingsReloaded event to make customizations after the default XAF template settings were applied. Also, you can handle the Form.HandleCreated or Form.Load event. Place your customization code into the OnFormReadyForCustomizations event handler.

As a result, the size of the target pop-up window is determined depending on the parent window size.

Expanded Customize a Pop-up Window Depending on its View

If you want to customize pop-up windows for a particular type, create a ObjectViewController<ViewType, ObjectType> Controller and specify the business object type. To maximize the DemoObject pop-up window, do the following:

See the example in the PopupWindowShowAction class description.

Note

Certain form templates (e.g., LookupForm, PopupForm, LookupControlTemplate) may have particular specifics.

  • Minimum form size may be set by default (the InitialMinimumSize property).
  • Size may be calculated dynamically based on the content.
  • The Form may have resizing restrictions (the IsSizeable property).
  • The Form size may automatically shrink (the AutoShrink property)
  • The Form may expand to occupy the whole space (the Maximized property).

Expanded See Also

How would you rate this topic?​​​​​​​