wpf icon indicating copy to clipboard operation
wpf copied to clipboard

WPF RadioButton bullet not centered

Open vsfeedback opened this issue 4 years ago • 5 comments

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)

vsfeedback avatar Oct 15 '21 21:10 vsfeedback

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.

vishalmsft avatar Oct 19 '21 15:10 vishalmsft

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.

appel1 avatar Oct 19 '21 15:10 appel1

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,

Krudonix avatar Jun 15 '22 11:06 Krudonix

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?

fraluderin avatar Mar 11 '24 22:03 fraluderin

We encountered the same issue and resolved it with the following properties. <Window ... UseLayoutRounding="True" SnapsToDevicePixels="True" />

WalchAndreas avatar Oct 13 '25 13:10 WalchAndreas