Odd visual behavior from ToolStripMenuItem

I have a drop-down menu that populates dynamically every time it opens, here is the logic that does this:

private void joysticksToolStripMenuItem_DropDownOpening(object sender, EventArgs e)
{
    _joysticks = _joystickWrapper.FindDevices(DeviceType.Joystick);
    joysticksToolStripMenuItem.DropDownItems.Clear();
    foreach (var di in _joysticks)
    {
        var item = new ToolStripMenuItem(di.ProductName);
        item.Checked = di.InstanceGuid == _joystickWrapper.CurrentDeviceInfo.InstanceGuid;
        joysticksToolStripMenuItem.DropDownItems.Add(item);
    }
}

When I run the application, this is what I see:

That cant be right ...

The check is in the wrong place and the blue area is too wide.

Any ideas on where to look to fix this? All menus are System.Windows.Formswithout special visual code throughout the application.

I tried on my computer (Windows 10 Build 9926) and on my dev server (Server 2012R2) with the same results. I also compiled this for NET Framework 4.5 and 4.5.1

EDIT

For those interested, here is the git repo for this project:

https://github.com/adam8797/RovControl

+4
2

, , , ImageScalingSize MenuStrip 16,16 ( - 32,32, , - DPI)

+6

, . , , . , , .

0

All Articles