GroupBox.UseCompatibleTextRendering 屬性


取得或設定值,決定要使用 Graphics 類別 (GDI+GDI+) 還是 TextRenderer 類別 (GDIGDI) 來呈現文字。Gets or sets a value that determines whether to use the Graphics class (GDI+GDI+) or the TextRenderer class (GDIGDI) to render text.

 property bool UseCompatibleTextRendering { bool get(); void set(bool value); };
public bool UseCompatibleTextRendering { get; set; }
member this.UseCompatibleTextRendering : bool with get, set
Public Property UseCompatibleTextRendering As Boolean


如果應該使用 Graphics 類別來執行與版本1.0 和1.1 的相容性文字轉譯,則 truetrue if the Graphics class should be used to perform text rendering for compatibility with versions 1.0 and 1.1. .NET Framework;否則,falseof the .NET Framework; otherwise, false. 預設為 falseThe default is false.


@No__t-0 屬性的目的是要提供 Windows Forms 控制項之間的視覺效果相容性,這些控制項會使用 @no__t 1 類別和 .NET Framework 1.0.NET Framework 1.0 和 @no__t 3 的應用程式(使用 Graphics 類別來執行自訂文字轉譯)來呈現文字。The UseCompatibleTextRendering property is intended to provide visual compatibility between Windows Forms controls that render text using the TextRenderer class and .NET Framework 1.0.NET Framework 1.0 and .NET Framework 1.1.NET Framework 1.1 applications that perform custom text rendering using the Graphics class. 在大多數情況下,如果您的應用程式未從 .NET Framework 1.0.NET Framework 1.0.NET Framework 1.1.NET Framework 1.1 升級,建議您將 UseCompatibleTextRendering 保持設定為預設值 [false]。In most cases, if your application is not being upgraded from .NET Framework 1.0.NET Framework 1.0 or .NET Framework 1.1.NET Framework 1.1, it is recommended that you leave UseCompatibleTextRendering set to the default value of false.

以 @no__t 為基礎的 @no__t 1 類別是在 .NET Framework 2.0.NET Framework 2.0 中引進,以改善效能、讓文字看起來更好,並改善國際字型的支援。The GDIGDI based TextRenderer class was introduced in the .NET Framework 2.0.NET Framework 2.0 to improve performance, make text look better, and improve support for international fonts. 在舊版的 .NET Framework.NET Framework 中,會使用以 @no__t 1 為基礎的 Graphics 類別來執行所有文字轉譯。In earlier versions of the .NET Framework.NET Framework, the GDI+GDI+ based Graphics class was used to perform all text rendering. GDIGDI 會計算不同于 GDI+GDI+ 的字元間距和換行。calculates character spacing and word wrapping differently from GDI+GDI+. 在使用 Graphics 類別來呈現文字的 Windows Forms 應用程式中,這可能會導致使用 TextRenderer 之控制項的文字,與應用程式中的其他文字出現不同。In a Windows Forms application that uses the Graphics class to render text, this could cause the text for controls that use TextRenderer to appear different from the other text in the application. 若要解決這種不相容性,您可以將特定控制項的 UseCompatibleTextRendering 屬性設定為 trueTo resolve this incompatibility, you can set the UseCompatibleTextRendering property to true for a specific control. 若要針對應用程式中所有支援的控制項,將 UseCompatibleTextRendering 設定為 true,請以 true 的參數呼叫 @no__t 2 方法。To set UseCompatibleTextRendering to true for all supported controls in the application, call the Application.SetCompatibleTextRenderingDefault method with a parameter of true.