diff --git a/src/System.Windows.Forms.Design/src/System/Drawing/SelectionPanelBase.SelectionPanelRadioButton.cs b/src/System.Windows.Forms.Design/src/System/Drawing/SelectionPanelBase.SelectionPanelRadioButton.cs index 569930b5389..f28c0afd11b 100644 --- a/src/System.Windows.Forms.Design/src/System/Drawing/SelectionPanelBase.SelectionPanelRadioButton.cs +++ b/src/System.Windows.Forms.Design/src/System/Drawing/SelectionPanelBase.SelectionPanelRadioButton.cs @@ -16,6 +16,26 @@ public SelectionPanelRadioButton() protected override bool ShowFocusCues => true; + protected override void WndProc(ref Message m) + { + base.WndProc(ref m); + + if (m.MsgInternal != PInvokeCore.WM_PAINT || !Focused || !ShowFocusCues) + { + return; + } + + Rectangle focusBounds = ClientRectangle; + focusBounds.Inflate(-LogicalToDeviceUnits(3), -LogicalToDeviceUnits(3)); + if (focusBounds.Width <= 0 || focusBounds.Height <= 0) + { + return; + } + + using Graphics g = CreateGraphics(); + ControlPaint.DrawFocusRectangle(g, focusBounds, ForeColor, BackColor); + } + protected override bool IsInputKey(Keys keyData) => keyData switch { Keys.Left or Keys.Right or Keys.Up or Keys.Down or Keys.Return => true,