You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes, cannot repro in .NET 6.0/7.0, regression from .NET 8.0
Issue description
Exception pops up when moving the mouse wheel up or down in ShortcutKeys property. Repro in .NET 10/9/8, cannot in .NET6/7
ShortcutKeysException.mp4
Debug log:
System.ComponentModel.InvalidEnumArgumentException
HResult=0x80070057
Message=The value of argument 'value' (65536) is invalid for Enum type 'Keys'. (Parameter 'value')
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.ToolStripMenuItem.set_ShortcutKeys(Keys value) in C:\Users\v-olzhan\source\repos\winforms\src\System.Windows.Forms\src\System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs:line 365
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Steps to reproduce
Create a Winforms .NET application with menuStrip and propertyGrid controls added
Add a toolStripMenuItem1 in menuStrip
Set propertyGrid's SelectedObject to toolStripMenuItem1
Build and run application
Find ShortcutKeys property in propertyGrid, click (None) value, then move the mouse wheel up or down
The text was updated successfully, but these errors were encountered:
ToolStripMenuItem.ShortcutKeys property type (Keys enum) has a TypeConverter that reports that it has a set of standard values. This is not entirely accurate. Keys type has a set of standard values, but the ShortcutKeys property does not, even the ShortcuKeys type contains different key combinations from what can be generated by the shortcut editor. Shortcuts are combinations of keys and modifiers, it's not practical to present all combinations for user to step through with up/down keys or with mouse wheel. I would like to add a new TypeConverter to this property. KeysConverter is defined on the Keys enum, the property does not have one right now. This change is considered "borderline" allowed depending on whether this is considered a changed attribute or a new one https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/breaking-change-rules.md#attributes.
This behavior regressed when we added Keys.None to the list of standard values - #8401. This was done to localize None in the property browser UI. When the current value of the shortcut is not one of the standard values, property grid entry does not enter the "scroll through the standard items" functionality - highlighted methods in the below stacks.
The same happens on the arrow navigation System.Windows.Forms.ToolStripMenuItem.ShortcutKeys.set Line 366
[Lightweight Function] Annotated Frame
System.Reflection.MethodBaseInvoker.InvokeWithOneArg
System.ComponentModel.ReflectPropertyDescriptor.SetValue
System.Windows.Forms.PropertyGridInternal.PropertyDescriptorGridEntry.SetPropertyValueCore Line 749
System.Windows.Forms.PropertyGridInternal.PropertyDescriptorGridEntry.SetPropertyValue Line 665
System.Windows.Forms.PropertyGridInternal.PropertyDescriptorGridEntry.PropertyValue.set Line 222
System.Windows.Forms.PropertyGridInternal.PropertyGridView.CommitValue Line 4658
System.Windows.Forms.PropertyGridInternal.PropertyGridView.ProcessEnumUpAndDown Line 2477
System.Windows.Forms.PropertyGridInternal.PropertyGridView.OnEditKeyDown Line 2497
System.Windows.Forms.Control.OnKeyDown Line 7636
System.Windows.Forms.PropertyGridInternal.PropertyGridView.GridViewTextBox.OnKeyDown Line 150
System.Windows.Forms.Control.ProcessKeyEventArgs Line 8883
System.Windows.Forms.Control.ProcessKeyMessage Line 8923
System.Windows.Forms.Control.WmKeyChar Line 11356
System.Windows.Forms.Control.WndProc Line 12291
Mouse wheel is supported for enumerable values, i.e. values with the standard values set. System.Windows.Forms.ToolStripMenuItem.ShortcutKeys.set Line 366
[Lightweight Function] Annotated Frame
System.Reflection.MethodBaseInvoker.InvokeWithOneArg
System.ComponentModel.ReflectPropertyDescriptor.SetValue
System.Windows.Forms.PropertyGridInternal.PropertyDescriptorGridEntry.SetPropertyValueCore Line 749
System.Windows.Forms.PropertyGridInternal.PropertyDescriptorGridEntry.SetPropertyValue Line 665
System.Windows.Forms.PropertyGridInternal.PropertyDescriptorGridEntry.PropertyValue.set Line 222
System.Windows.Forms.PropertyGridInternal.PropertyGridView.CommitValue Line 4658
System.Windows.Forms.PropertyGridInternal.PropertyGridView.CommitValue Line 4622
System.Windows.Forms.PropertyGridInternal.PropertyGridView.OnMouseWheel Line 3155
System.Windows.Forms.Control.WmMouseWheel Line 11620
System.Windows.Forms.Control.WndProc Line 12429
System.Windows.Forms.PropertyGridInternal.PropertyGridView.WndProc Line 5367
.NET version
.NET 10 SDK build: 10.0.100-preview.2.25118.3
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes, cannot repro in .NET 6.0/7.0, regression from .NET 8.0
Issue description
Exception pops up when moving the mouse wheel up or down in ShortcutKeys property. Repro in .NET 10/9/8, cannot in .NET6/7
ShortcutKeysException.mp4
Debug log:
System.ComponentModel.InvalidEnumArgumentException
HResult=0x80070057
Message=The value of argument 'value' (65536) is invalid for Enum type 'Keys'. (Parameter 'value')
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.ToolStripMenuItem.set_ShortcutKeys(Keys value) in C:\Users\v-olzhan\source\repos\winforms\src\System.Windows.Forms\src\System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs:line 365
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Steps to reproduce
(None)
value, then move the mouse wheel up or downThe text was updated successfully, but these errors were encountered: