Application.EnableVisualStyles() not working
I cann't make my application to apply Windows visual styles. Application.EnableVisualStyles() in program.cs not changing RenderWithVisualStyle property to true.
[STAThread]
public static void Main(string[] startArgument)
{
开发者_如何学Python Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
.....
}
Interestingly if I'm debugging with "Enable visual studio hosting process", Application.EnableVisualStyles() works as expected, RenderWithVisualStyle goes to true and styles are applied. But no styles without hosting process either Debug or Release mode. Changing target framework v.2 to v.3.5 makes nothing.
Any ideas please, I'm stuck with this issue and googling for 3 days with no success.
Many thanks
You need to embed a manifest XML file that specifies that the new version of the common controls DLL should be used. See the MSDN article on visual styles for more information on how to do this.
精彩评论