Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WPF MessageBox看起来没有样式,而WindowsForms MessageBox看起来不错_C#_Wpf_Winforms_Messagebox - Fatal编程技术网

C# WPF MessageBox看起来没有样式,而WindowsForms MessageBox看起来不错

C# WPF MessageBox看起来没有样式,而WindowsForms MessageBox看起来不错,c#,wpf,winforms,messagebox,C#,Wpf,Winforms,Messagebox,由于某些原因,WPF MessageBox看起来比WindowsForms中的更糟糕。WPF one没有视觉样式 如何将Windows样式应用于WPF MessageBox WindowsForms WPF 可以通过添加应用程序清单(添加->新项目->应用程序清单文件)来解决此问题 。。。 在“项目属性”下,将“清单”指向刚创建的文件。这是可选的,因为清单也可以与EXE文件一起部署 注意:此清单可用于任何需要“样式化”的可执行文件,而不仅仅是WPF。您可以更改WPF消息框的样式。或者我想要默

由于某些原因,WPF MessageBox看起来比WindowsForms中的更糟糕。WPF one没有视觉样式

如何将Windows样式应用于WPF MessageBox

WindowsForms

WPF


可以通过添加应用程序清单(添加->新项目->应用程序清单文件)来解决此问题

。。。
在“项目属性”下,将“清单”指向刚创建的文件。这是可选的,因为清单也可以与EXE文件一起部署


注意:此清单可用于任何需要“样式化”的可执行文件,而不仅仅是WPF。

您可以更改WPF消息框的
样式。或者我想要默认的Windows样式,就像在WindowsForms中一样,而不是自定义绘制的样式。看起来使用的是Windows 7样式,尽管您显然在Windows 8.x下。这是WPF中的一个bug。您应该报告连接/创建UserVoice请求。这是Windows经典风格,甚至不是Windows 7。我认为现在创建bug请求对我没有帮助。是否有任何修复,比如某种样式清单?@bytecode77您仍然应该报告此错误。否则它永远也不会被修复。看看WPF内部代码,它似乎只是在内部调用user32.dll。我想知道为什么winforms one看起来会有什么不同。
    ...
</trustInfo>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="*"
            publicKeyToken="6595b64144ccf1df"
            language="*" />
    </dependentAssembly>
</dependency>