WindowsFormsApplicationBase.UseCompatibleTextRendering 属性

定义

当在派生类中重写时,此属性允许设计器为应用程序窗体指定默认的文本呈现引擎。When overridden in a derived class, this property allows a designer to specify the default text rendering engine for the application's forms.

protected:
 static property bool UseCompatibleTextRendering { bool get(); };
protected static bool UseCompatibleTextRendering { get; }
member this.UseCompatibleTextRendering : bool
Protected Shared ReadOnly Property UseCompatibleTextRendering As Boolean

属性值

Boolean

Boolean.Boolean. 值为 False 指示应用程序应使用 Visual Basic 2005Visual Basic 2005 的默认文本呈现引擎。A value of False indicates that the application should use the default text rendering engine for Visual Basic 2005Visual Basic 2005. 如果该值为 True,则指示应用程序应使用 Visual Basic .NET 2002 和 Visual Basic .NET 2003 的文本呈现引擎。A value of True indicates that the application should use the text rendering engine for Visual Basic .NET 2002 and Visual Basic .NET 2003.

示例

此示例演示如何通过重写属性,将 GDI + 文本呈现引擎设置为应用程序的默认呈现引擎 UseCompatibleTextRenderingThis 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. 有关详细信息,请参阅 Application Page, Project Designer (Visual Basic)(应用程序页、项目设计器 (Visual Basic)。For more information, see Application Page, Project Designer (Visual Basic).

注解

默认情况下,此属性返回 False 以指示 Visual Basic 2005Visual Basic 2005 要用于应用程序窗体的 GDI 文本呈现引擎。By default, this property returns False to indicate that the GDI text rendering engine for Visual Basic 2005Visual Basic 2005 be used for the application's forms. 但是,你可以重写此属性以返回 True ,并指定应用程序的窗体使用在 Visual Basic .net 2002 和 Visual Basic .net 2003 中使用的 GDI + 文本呈现引擎。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.

此属性由 WindowsFormsApplicationBase 构造函数调用。This property is called by the WindowsFormsApplicationBase constructor.

WindowsFormsApplicationBase在默认情况下,将在 applicationevents.vb 文件中输入用于重写类的方法的代码。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. 在 解决方案资源管理器 中选择一个项目,然后单击 "项目" 菜单上的 "属性"。1. With a project selected in Solution Explorer, click Properties on the Project menu.
2.单击“应用程序” 选项卡。2. Click the Application tab.
3. 单击 " 查看应用程序事件 " 按钮以打开代码编辑器。3. Click the View Application Events button to open the Code Editor.

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

适用于

另请参阅