微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么我的Windows 8 WPF单选按钮全部脱离了?

在Windows 8 RTM与VS2012 RTM我注意到我的WPF应用程序给我变形的单选按钮,所以我决定创建一个样本,看看我是否做错了。

这是整个XAML应用程序:

<Window x:Class="WpfApplication1.MainWindow" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" SizetoContent="WidthAndHeight">
    <Grid>
        <StackPanel Margin="20">
            <RadioButton Content="Option 1" GroupName="1"/>
            <RadioButton Content="Option 2" GroupName="2"/>
            <RadioButton Content="Option 3" GroupName="3"/>
        </StackPanel>
    </Grid>
</Window>

这里我将DPI设置设置为100%,这实际上不是Windows 8中的认设置(至少对于我的1920×1200屏幕而言)。你会看到单选按钮是完美的。

这是与DPI设置为125%相同的确切应用程序,这是我屏幕分辨率的认DPI。

这里是150%

您可以看到内圈不在外圈内居中,看起来很可怕。使用单选按钮的系统应用程序很好 – 但我的WPF 4.5应用程序不是。再次这个示例应用程序是100%RTM位,从Win 8开始。

这是否全部破裂或有办法解决这个问题(除了坚持让100%DPI缩放的人)。

真的希望Win8对于这样的高分辨率屏幕和缩放问题来说已经走了很长的路要走,但是简单的一个简单的例子是:

编辑:提交连接错误https://connect.microsoft.com/VisualStudio/feedback/details/758368/radio-button-rendering-is-incorrect-on-windows-8-with-125-dpi-scaling-set

编辑:8/29/12:

The WPF team has recently reviewed this issue and will not be
addressing this issue as at this time the team is focusing on the bugs
impacting the highest number of WPF developers. If you believe that
this was resolved in error,please reactivate this bug with any
necessary supporting details.

WPF中的所有内容都是样式的。在认的系统风格的情况下,他们有时候,根据我自己的经验,这样的问题很少。一个简单的修复,确认它是风格,而不是操作系统本身是自己修复控件,看看是否修复它。

您可以通过查看this的问题找到原始风格。这些将帮助您重建和/或修复问题

原文地址:https://www.jb51.cc/windows/372521.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐