Skip to main content

AppearanceObject.Font Property

Gets or sets the font used to paint the text.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v24.1.dll

NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

Declaration

[XtraSerializableProperty]
[DXCategory("Font")]
public virtual Font Font { get; set; }

Property Value

Type Description
Font

A Font object specifying the font used to display the contents of elements.

Remarks

The following example specifies custom fonts and font settings of a simple button and grid columns:

Apply Custom Font Settings for DevExpress WinForms Controls

using System.Drawing;

namespace DXApplication {
    public partial class Form1 : DevExpress.XtraEditors.XtraForm {
        public Form1() {
            InitializeComponent();
            simpleButton1.Appearance.Font = new Font("Arial", 12, FontStyle.Bold);

            gridColumn1.AppearanceHeader.Font = new Font("Courier New", 14, FontStyle.Bold);
            gridColumn1.AppearanceCell.Font = new Font("Courier New", 10, FontStyle.Bold);

            gridColumn2.AppearanceHeader.Font = new Font("Times New Roman", 14, FontStyle.Underline);
            gridColumn2.AppearanceCell.Font = new Font("Times New Roman", 10, FontStyle.Underline);

            gridView1.OptionsView.ColumnHeaderAutoHeight = DevExpress.Utils.DefaultBoolean.True;
        }
    }
}

Default Application Font

DevExpress WinForms controls use the “Tahoma” font as the default font. Use the following properties to change the default font used by DevExpress controls in your application:

Read the following topic for additional information: Default Application Font.

Appearance Settings Inheritance

Setting the Font property to the control’s default font (which is currently used by the user’s operating system) automatically sets the appearance object’s AppearanceOptions.UseFont property to false. If the UseFont property is set to false and the current Appearance object has a parent Appearance object, the Appearance object uses the parent’s font settings.

Use the AppearanceObject.GetFont method to obtain the font settings specified by the appearance object’s settings.

Read the following topics for additional information:

The following code snippets (auto-collected from DevExpress Examples) contain references to the Font property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also