开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜