dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.38k stars 971 forks source link

The ToolStripMenuItem cannot be deleted successfully using Delete key in the DemoConsole application #11794

Open MelonWang1 opened 2 months ago

MelonWang1 commented 2 months ago

.NET version

feature/10.0 branch of Winforms repo

Did it work in .NET Framework?

Not tested/verified

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No, this issue also repro in .NET 9.0 main branch of WinForms repo branch of WinForms repo.

Issue description

More info:

  1. This issue cannot repro when using Delete key to delete other control, and then delete ToolStripMenuItem.
  2. This issue cannot repro when using Delete in Edit menu.

Actual result in [DemoConsole] test app: The ToolStripMenuItem cannot be deleted successfully using Delete key.

https://github.com/user-attachments/assets/efe0612c-ad63-43e9-898c-001ddc9a2c2e

Expected result: The ToolStripMenuItem can be deleted successfully using Delete key.

Steps to reproduce

Test sample: DemoConsole bases on feature/10.0 branch in Winforms repo.

merriemcgaw commented 2 months ago

@MelonWang1 is this a regression, and when was the functionality to delete added to the demo app?

MelonWang1 commented 2 months ago

@merriemcgaw It's not a regression issue, for ContextMenuStrip to add item is support in .NET 9.0. In release/7.0 and release/8.0 branch, can using Delete key to delete controls from the DemoConsole application.

LeafShi1 commented 1 month ago

This should be a keyboard issue, because the menu item is successfully deleted by clicking the delete item of the context menu

BeforeChanges