wpf
wpf copied to clipboard
WPF RadioButton bullet not centered
This issue has been moved from a ticket on Developer Community.
[severity:It bothers me. A fix would be nice] Create a WPF app using either .NET Framework 4.8 or .NET 5.0. Add one or more RadioButton elements. Run app and make a radio button checked. The dot in the RadioButton is drawn off center.
Original Comments
Feedback Bot on 10/14/2021, 11:51 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Original Solutions
(no solutions)
This is due to LayoutRounding decision. When radio buttons are presented, the rounding operation for buttons causes it. This is a known issue and a non-blocker.
According to https://docs.microsoft.com/en-us/dotnet/api/system.windows.frameworkelement.uselayoutrounding?view=windowsdesktop-5.0 and https://docs.microsoft.com/en-us/dotnet/api/system.windows.uielement.snapstodevicepixels?view=windowsdesktop-5.0 both UseLayoutRounding and SnapsToDevicePixels are false på default. Is that not true or not true for RadioButton? Setting them explicitly to false does not seem to make any difference.
Hi,
We ran into the exact same problem.
We managed to find a work around which worked well for us.
Changing the default style by updating the markGrid margin from 2 to 3 worked wonders for us.
Hope this helps someone.
Regards,
Hi,
We ran into the exact same problem.
We managed to find a work around which worked well for us.
Changing the default style by updating the markGrid margin from 2 to 3 worked wonders for us.
Hope this helps someone.
Regards,
Tried this workaround but it's not working for me. Net 8.0.2, Win 11. It seems it's caused by display scaling: if I switch from 150% (default on my screen) to 100%, bullets get properly centered.
Are there any news on this issue?
We encountered the same issue and resolved it with the following properties.
<Window ... UseLayoutRounding="True" SnapsToDevicePixels="True" />