Export (0) Print
Expand All

WindowsFormsApplicationBase.UseCompatibleTextRendering Property

When overridden in a derived class, this property allows a designer to specify the default text rendering engine for the application's forms.

Namespace:  Microsoft.VisualBasic.ApplicationServices
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

protected static bool UseCompatibleTextRendering { get; }

Property Value

Type: System.Boolean
Boolean. A value of False indicates that the application should use the default text rendering engine for Visual Basic 2005. A value of True indicates that the application should use the text rendering engine for Visual Basic .NET 2002 and Visual Basic .NET 2003.

By default, this property returns False to indicate that the GDI text rendering engine for Visual Basic 2005 be used for the application's forms. However, you can override this property to return True and specify that the application's forms use the GDI+ text rendering engine, which is used in Visual Basic .NET 2002 and Visual Basic .NET 2003.

This property is called by the WindowsFormsApplicationBase constructor.

Code that overrides methods of the WindowsFormsApplicationBase class should be entered in the ApplicationEvents.vb file, which is hidden by default.

To access the Code Editor window for overriding members

  1. With a project selected in Solution Explorer, click Properties on the Project menu.

  2. Click the Application tab.

  3. Click the View Application Events button to open the Code Editor.

    For more information, see Application Page, Project Designer (Visual Basic).

This example demonstrates how to set the GDI+ text rendering engine as the application's default rendering engine by overriding the UseCompatibleTextRendering property.

Protected Overloads Shared ReadOnly Property UseCompatibleTextRendering() As Boolean
    Get
        ' Use the GDI+ text rendering engine.
        Return True
    End Get
End Property

You must enter this code in the Code Editor window for application events. For more information, see Application Page, Project Designer (Visual Basic).

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft