Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down