I've got a Drop Down Menu that is dynamically filled every time it opens, here is the logic that does it:
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:
The check is in the wrong location and the blue area is too wide.
Any ideas on where to look to fix this? The entire menu is all System.Windows.Forms
, no custom visual code in the entire application.
I tried on my current machine (Windows 10 Build 9926) and on my dev server (Server 2012R2) with the same results. I've also compiled this to the 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
I came across this exact same issue and was finally able to resolve it by setting the ImageScalingSize
property of the MenuStrip to 16,16
(it had somehow been set to 32,32, possibly due to my editing of the form on a high DPI machine)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With