public static void EnableVisualStyles ()
此方法为应用程序启用可视样式。如果控件和操作系统支持视觉样式,则控件将以视觉样式进行绘制。若要使 EnableVisualStyles生效,必须在应用程序中创建任何控件之前调用它;EnableVisualStyles 通常是 Main 函数的第一行。当调用 EnableVisualStyles时,无需单独的清单即可启用可视化样式。

[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new Form1());
}

Application.SetCompatibleTextRenderingDefault函数
MSDN 解释如下:
某些 Windows 窗体控件可以使用 GDI 图形库或更新的 GDI+ 库来呈现其文本。由于 GDI+ 的性能和本地化问题而做出这样的更改。默认情况下,将支持UseCompatibleTextRendering 属性的现有控件设置为 true 以获得向后兼容性,但 Visual Studio 等环境中的所有新控件都将该属性设置为 false。要切换新控件的默认文本呈现时,请使用 SetCompatibleTextRenderingDefault。
如果在另一个应用程序中承载 Windows 窗体代码,例如 Internet Explorer,切勿调用该方法。仅在独立的 Windows 窗体应用程序中调用该方法。
[MSDN]

: https://blog.darkmi.com/2013/07/30/798.html

本文相关评论 - 1条评论都没有呢
Post a comment now » 本文目前不可评论

No comments yet.

Sorry, the comment form is closed at this time.