WindowsFormsApplicationBase.UseCompatibleTextRendering 属性

定义

当在派生类中重写时,此属性允许设计器为应用程序窗体指定默认的文本呈现引擎。

C#
protected static bool UseCompatibleTextRendering { get; }

属性值

Boolean. 值 指示 False 应用程序应使用 Visual Basic 2005 的默认文本呈现引擎。 如果该值为 True,则指示应用程序应使用 Visual Basic .NET 2002 和 Visual Basic .NET 2003 的文本呈现引擎。

示例

此示例演示如何通过重写 UseCompatibleTextRendering 属性将 GDI+ 文本呈现引擎设置为应用程序的默认呈现引擎。

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

必须在应用程序事件的“代码编辑器”窗口中输入此代码。 有关详细信息,请参阅 Application Page, Project Designer (Visual Basic)(应用程序页、项目设计器 (Visual Basic)。

注解

默认情况下,此属性返回 False 以指示 Visual Basic 2005 的 GDI 文本呈现引擎用于应用程序的表单。 但是,可以重写此属性以返回 True 并指定应用程序的表单使用在 Visual Basic .NET 2002 和 Visual Basic .NET 2003 中使用的 GDI+ 文本呈现引擎。

此属性由 WindowsFormsApplicationBase 构造函数调用。

替代 类方法的代码 WindowsFormsApplicationBase 应在默认隐藏的 ApplicationEvents.vb 文件中输入。

访问代码编辑器窗口以重写成员
1. 在解决方案资源管理器中选择项目后,单击“项目”菜单上的“属性”。
2. 单击“应用程序”选项卡。
3. 单击“ 查看应用程序事件 ”按钮以打开代码编辑器。

有关详细信息,请参阅 Application Page, Project Designer (Visual Basic)(应用程序页、项目设计器 (Visual Basic)。

适用于

产品 版本
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 5, 6, 7, 8, 9

另请参阅