WebBrowser control blocks accelerators of buttons on form
- Dominant language
- C#
- Stars
- 4.9k
- Forks
- 1.1k
- Avg merge
- 20h 23m
- Merged PRs (30d)
- 103
Description
### .NET version
.NET 6.0, .NET 7.0
### Did it work in .NET Framework?
Yes
### Did it work in any of the earlier releases of .NET Core or .NET 5+?
.NET 4.8
### Issue description
See attached sample: I have a "System.Windows.Forms.WebBrowser" control on a UserControl.
The UserControl and the root form contain buttons with accelerator keys. In .NET6, the accelerators for the buttons don't work reliable.
### Steps to reproduce
Focus the textbox on the UserControl, then press "Alt" and one of the accelerator keys "B" or "O".
- The button on the user control will be clicked when pressing the accelerator the second time. On first button press, nothing happens.
- The "OK" button on the root form is never called.
The sample also has target framework 4.8 to demonstrate that this it worked there.
[WebBrowserTest.zip](https://github.com/dotnet/winforms/files/10990996/WebBrowserTest.zip)
The event "WebBrowserControl.PreviewKeyDown" is called twice for each button. This means I cannot handle a "Alt + accelerator" press myself (and search for a button with this accelerator).
Contributor guide
Assessment
This issue has not been assessed yet.