Current filter:
                                You should refresh the page.
                                  • WinForms

                                    In an XAF application, you can integrate standard solutions recommended for DevExpress WinForms controls depending on one of the two use-case scenarios:

                                    1. Static: If you need to perform this adjustment only once, set the static DefaultFont and DefaultMenuFont properties of the DevExpress.XtraEditors.WindowsFormsSettings class in YourSolutionName.Win/Program.xx file or any other place before the actual form is shown.

                                    2. Dynamic: If you need to perform font updates at runtime when the form is already created and shown, you cannot use the DevExpress.XtraEditors.WindowsFormsSettings.DefaultMenuFont property. That is because the BarAndDockingController settings are cached and not reset by default (this may be changed in the future versions of our WinForms Suite). So, for now, consider the following approach: close the form, customize the BarAndDockingController class properties as detailed in the Appearance and Look and Feel > Bar and Docking Controller documentation article, and then reopen your form.
                                    As for the XAF integration, refer to the following WindowController:

                                    using System; using System.Drawing; using DevExpress.Utils; using DevExpress.XtraBars; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Win.Controls; namespace YourSolutionName.Module.Win { public class S35762 : WindowController { static S35762() { AppearanceObject.DefaultFont = new Font("Segoe UI", 10); } protected override void OnActivated() { base.OnActivated(); Window.TemplateChanged += Window_TemplateChanged; } private void Window_TemplateChanged(object sender, EventArgs e) { if(Frame.Template is IBarManagerHolder) { BarManager manager = ((IBarManagerHolder)Frame.Template).BarManager; if(manager.Controller == null) { manager.Controller = new BarAndDockingController(); } var controller = manager.Controller; controller.AppearancesBar.MainMenu.Font = AppearanceObject.DefaultFont; controller.AppearancesBar.ItemsFont = AppearanceObject.DefaultFont; } } protected override void OnDeactivated() { Window.TemplateChanged -= Window_TemplateChanged; base.OnDeactivated(); } } }

                                    Note: this code is designed for the new XAF WinForms templates (WinApplication.UseOldTemplates = False).

                                    You can change these settings either via CSS or via code, programmatically. Refer to the How can i change default font in web application ticket for more details and specific examples.

                                    Depending on your business requirements, you can change these font settings dynamically via custom Actions or attributes in the Model Editor tool. Refer to the How to: Extend the Application Model and Add an Action with Option Selection help topics to learn more on how to enhance these solutions further. A good reference implementation that joins these two concepts together in one sample project can be found in the How to globally change font size of all UI controls (editors, toolbar and context menus, etc.)  ticket (WinForms only).

                                0 Solutions

                                Creation Date Importance Sort by