在 Main 方法调用 Application.Run() 之前,添加两行代码:
Application.EnableVisualStyles();
Application.DoEvents();
或者,在 .exe 文件的同一目录下添加一个程序文件名.exe.manifest 的文件,内容为:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="程序名"
type="win32" />
<description>.NET control deployment tool</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>