开发者

Application.EnableVisualStyles() not working

开发者 https://www.devze.com 2023-01-25 10:22 出处:网络
I cann\'t make my application to apply Windows visual styles. Application.EnableVisualStyles() in program.cs not changing RenderWithVisualStyle property to true.

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

精彩评论

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

关注公众号