Open
Description
.NET version
The latest main 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+?
Yes. It was regressed from the PR: #13360
Issue description
In DemoConsole test app of WinForms repo, an exception pops up when focusing on "Type Here" in contextMenuStrip under DarkMode
Exception log:
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.ToolStripSystemDarkModeRenderer.OnRenderArrow(ToolStripArrowRenderEventArgs e) in C:\Users\xxx\source\repos\winforms\src\System.Windows.Forms\System\Windows\Forms\Controls\ToolStrips\ToolStripSystemDarkModeRenderer.cs:line 566
Exception.mp4
Steps to reproduce
- Find the sample app: DemoConsole in Winforms repo
- Change it to .NET targeting only from Multi-targets
- Enable Dark mode by adding below code lines in the Program.cs file under DemoConsole project
#pragma warning disable WFO5001
Application.SetColorMode(SystemColorMode.Dark);
#pragma warning restore WFO5001
- Run DemoConsole app
- Find ContextMenuStrip control in 'Use SnapLines' tabPage, then move mouse to 'Type Here' area