[Expand]General Information
[Expand]WinForms Controls
[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]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Expand]Concepts
 [Expand]Design-Time Features
 [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 Detail View Using a Custom View Item
    How to: Add an XAF Mobile Custom Module
    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 (WinForms)
    How to: Enable High DPI Support in a WinForms Application
    How to: Implement a Custom Messaging Class
    How to: Implement Client-Side Logic in Mobile Applications
    How to: Include an Action to a Detail View Layout
    How to: Raise XAF Callbacks from Client-Side Events and Process these Callbacks on Server
    How to: Set Images and Captions for Enumeration Values
    How to: Show a Custom Window with an Embedded XAF View
    How to: Show a Custom Windows Form
    How to: Use a Custom Plugin in a Mobile Application
    How to: Use a Custom Splash Screen
    How to: Use a DevExtreme Chart in a Mobile Application
    How to: Use Custom Themes in ASP.NET Applications
  Frequently Asked Questions (FAQ)
 [Expand]API Reference
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[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: Customize Window Status Messages (WinForms)

A status bar of a typical Windows Forms XAF application Window displays a currently authenticated user name, when the application uses a Security System.

This topic describes how to add a custom status message and how to replace the default message with a custom one.

Expanded Add a Custom Status Message

The WindowTemplateController is activated in all Windows and updates the current Window status and caption. The WindowTemplateController exposes the WindowTemplateController.CustomizeWindowStatusMessages event, which occurs before Window status messages are updated and allows you to modify them. The status messages are a collection of strings in XAF.

To add a status message, create a custom Window Controller, subscribe to the CustomizeWindowStatusMessages event and handle it. Add a custom string to the StatusMessages collection in the CustomizeWindowStatusMessages event handler.

The following image illustrates a custom status message displayed together with a default message:

Expanded Replace the Default Status Message

To replace a current status messages collection with a custom one, clear the StatusMessages collection before adding a custom message in the CustomizeWindowStatusMessages event handler.

The following image illustrates a displayed custom status message, instead of a default one:

You can use the WindowTemplateController.UpdateWindowStatusMessage method to refresh status messages when required.

Note

This topic concerns Windows Form applications only. Although the WindowTemplateController Controller is a platform-independent System Module Built-in Controller, status messages are invisible in ASP.NET applications.

To put anything besides text messages into the Status Bar, consider creating a custom window template or subscribe to the WindowTemplateController.CustomizeStatusBar event and access the bar directly. Refer to the How to: Access the Bar Manager and How to: Access the Ribbon Control articles and the XtraBars product documentation.

Expanded See Also

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