|
488 | 488 | <format type="text/markdown"><![CDATA[
|
489 | 489 |
|
490 | 490 | ## Remarks
|
491 |
| - This method enables visual styles for the application. Visual styles are the colors, fonts, and other visual elements that form an operating system theme. Controls will draw with visual styles if the control and the operating system support it. To have an effect, <xref:System.Windows.Forms.Application.EnableVisualStyles> must be called before creating any controls in the application; typically, <xref:System.Windows.Forms.Application.EnableVisualStyles> is the first line in the `Main` function. A separate manifest is not required to enable visual styles when calling <xref:System.Windows.Forms.Application.EnableVisualStyles>. |
| 491 | + This method enables visual styles for the application. Visual styles are the colors, fonts, and other visual elements that form an operating system theme. Controls will draw with visual styles if the control and the operating system support it. To have an effect, <xref:System.Windows.Forms.Application.EnableVisualStyles> must be called before creating any controls in the application; typically, <xref:System.Windows.Forms.Application.EnableVisualStyles> is the first line in the `Main` function. A separate manifest is not required to enable visual styles when calling <xref:System.Windows.Forms.Application.EnableVisualStyles>. |
492 | 492 |
|
493 | 493 | > [!NOTE]
|
494 |
| -> Prior to the .NET Framework 2.0, the `FlatStyle` property of some controls, such as controls that derive from <xref:System.Windows.Forms.ButtonBase>, had to be set to <xref:System.Windows.Forms.FlatStyle.System?displayProperty=nameWithType> in order for the controls to be drawn with visual styles. In applications written with the .NET Framework 2.0, this is no longer necessary. |
495 |
| - |
496 |
| -> [!NOTE] |
497 |
| -> This method will have no effect for controls hosted in Internet Explorer. |
498 |
| - |
499 |
| - |
| 494 | +> This method has no effect for controls hosted in Internet Explorer. |
500 | 495 |
|
501 | 496 | ## Examples
|
502 | 497 | The following code example demonstrates calling <xref:System.Windows.Forms.Application.EnableVisualStyles%2A> in the `Main` function to enable visual styles for the application.
|
|
1635 | 1630 | <format type="text/markdown"><![CDATA[
|
1636 | 1631 |
|
1637 | 1632 | ## Remarks
|
1638 |
| - Certain Windows Forms controls can render their text using either the <xref:System.Windows.Forms.TextRenderer> class, which is based on the GDI graphics library, or the <xref:System.Drawing.Graphics> class, which is based on the GDI+ graphics library. This change was made in the .NET Framework 2.0 because of performance and localization issues with GDI+. Use <xref:System.Windows.Forms.Application.SetCompatibleTextRenderingDefault%2A> to set the default value of the `UseCompatibleTextRendering` property for controls that support it. |
1639 |
| - |
1640 |
| - The `UseCompatibleTextRendering` property is intended to provide visual compatibility between Windows Forms controls that render text using the <xref:System.Windows.Forms.TextRenderer> class and .NET Framework 1.0 and .NET Framework 1.1 applications that perform custom text rendering using the <xref:System.Drawing.Graphics> class. In most cases, if your application is not being upgraded from .NET Framework 1.0 or .NET Framework 1.1, it is recommended that you leave `UseCompatibleTextRendering` set to the default value of `false`. |
| 1633 | + Certain Windows Forms controls can render their text using either the <xref:System.Windows.Forms.TextRenderer> class, which is based on the GDI graphics library, or the <xref:System.Drawing.Graphics> class, which is based on the GDI+ graphics library. This change was made in .NET Framework 2.0 because of performance and localization issues with GDI+. Use <xref:System.Windows.Forms.Application.SetCompatibleTextRenderingDefault%2A> to set the default value of the `UseCompatibleTextRendering` property for controls that support that property. |
1641 | 1634 |
|
1642 |
| - The GDI based <xref:System.Windows.Forms.TextRenderer> class was introduced in the .NET Framework 2.0 to improve performance, make text look better, and improve support for international fonts. In earlier versions of the .NET Framework, the GDI+ based <xref:System.Drawing.Graphics> class was used to perform all text rendering. GDI calculates character spacing and word wrapping differently from GDI+. In a Windows Forms application that uses the <xref:System.Drawing.Graphics> class to render text, this could cause the text for controls that use <xref:System.Windows.Forms.TextRenderer> to appear different from the other text in the application. To resolve this incompatibility, you can set the `UseCompatibleTextRendering` property to `true`. To set `UseCompatibleTextRendering` to `true` for all supported controls in the application, call the <xref:System.Windows.Forms.Application.SetCompatibleTextRenderingDefault%2A> method with a parameter of `true`. |
| 1635 | + The `UseCompatibleTextRendering` property is intended to provide visual compatibility between Windows Forms controls that render text using the <xref:System.Windows.Forms.TextRenderer> class and apps that perform custom text rendering using the <xref:System.Drawing.Graphics> class. In most cases, if your application is not being upgraded from .NET Framework 1.0 or .NET Framework 1.1, it is recommended that you leave `UseCompatibleTextRendering` set to the default value of `false`. |
1643 | 1636 |
|
1644 |
| - You should never call this method if your Windows Forms code is hosted in another application, such as Internet Explorer. Only call this method in stand-alone Windows Forms applications. |
| 1637 | + The GDI-based <xref:System.Windows.Forms.TextRenderer> class was introduced in .NET Framework 2.0 to improve performance, make text look better, and improve support for international fonts. In earlier versions of .NET Framework, the GDI+ based <xref:System.Drawing.Graphics> class was used to perform all text rendering. GDI calculates character spacing and word wrapping differently from GDI+. In a Windows Forms application that uses the <xref:System.Drawing.Graphics> class to render text, this could cause the text for controls that use <xref:System.Windows.Forms.TextRenderer> to appear different from the other text in the application. To resolve this incompatibility, you can set the `UseCompatibleTextRendering` property to `true`. To set `UseCompatibleTextRendering` to `true` for all supported controls in the application, call the <xref:System.Windows.Forms.Application.SetCompatibleTextRenderingDefault%2A> method with an argument of `true`. |
1645 | 1638 |
|
1646 |
| - |
| 1639 | + You should never call this method if your Windows Forms code is hosted in another application, such as Internet Explorer. Only call this method in stand-alone Windows Forms applications. |
1647 | 1640 |
|
1648 | 1641 | ## Examples
|
1649 | 1642 |
|
1650 | 1643 | > [!IMPORTANT]
|
1651 | 1644 | > To set the default value for `UseCompatibleTextRendering` in Visual Basic 2005 or later, see <xref:Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.UseCompatibleTextRendering%2A?displayProperty=nameWithType>.
|
1652 | 1645 |
|
1653 |
| - In Visual C# 2005 or later, a call to <xref:System.Windows.Forms.Application.SetCompatibleTextRenderingDefault%2A> is automatically generated in the Program.cs file. To change the text rendering default, modify the generated code. |
| 1646 | +For C# apps, Visual Studio automatically adds a call to <xref:System.Windows.Forms.Application.SetCompatibleTextRenderingDefault%2A> in the *Program.cs* file. To change the text rendering default, modify the generated code. |
1654 | 1647 |
|
1655 | 1648 | ```csharp
|
1656 | 1649 | static class Program
|
|
0 commit comments