Back to Devexpress

AppearanceObject.DefaultFont Property

windowsforms-devexpress-dot-utils-dot-appearanceobject-92bdf9c9.md

latest3.6 KB
Original Source

AppearanceObject.DefaultFont Property

Gets or sets the default font for controls.

Namespace : DevExpress.Utils

Assembly : DevExpress.Utils.v25.2.dll

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

Declaration

csharp
[DXCategory("Appearance")]
public static Font DefaultFont { get; set; }
vb
<DXCategory("Appearance")>
Public Shared Property DefaultFont As Font

Property Value

TypeDescription
Font

A Font object which is the default font for controls. The default value is the Tahoma font.

|

Remarks

This property is in sync with the WindowsFormsSettings.DefaultFont property. See this topic to learn more.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DefaultFont 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.

winforms-grid-print-custom-draw-content/CS/MyXtraGrid/Form1.cs#L42

csharp
e.Cache.DrawEllipse(e.Cache.GetPen(Color.Red, 3), rect);
    e.Cache.DrawString("Custom Draw", AppearanceObject.DefaultFont, Brushes.Black, e.Bounds);
}

winforms-grid-update-row-style-on-cell-value-change/CS/Form1.cs#L37

csharp
{
    AppearanceObject.DefaultFont = new Font(AppearanceObject.DefaultFont.FontFamily, 14, FontStyle.Bold);
    InitializeComponent();

winforms-grid-print-custom-draw-content/VB/MyXtraGrid/Form1.vb#L42

vb
e.Cache.DrawEllipse(e.Cache.GetPen(Color.Red, 3), rect)
    e.Cache.DrawString("Custom Draw", AppearanceObject.DefaultFont, Brushes.Black, e.Bounds)
End Sub

winforms-grid-update-row-style-on-cell-value-change/VB/Form1.vb#L36

vb
Public Sub New()
    AppearanceObject.DefaultFont = New Font(AppearanceObject.DefaultFont.FontFamily, 14, FontStyle.Bold)
    InitializeComponent()

See Also

DefaultFont

AppearanceObject Class

AppearanceObject Members

DevExpress.Utils Namespace