winforms
winforms copied to clipboard
[DarkMode] Button Click not working when Swithch Window OS ColorMode
.NET version
The latest main branch of Winforms "10.0.0-preview.7.25318.105"
Did it work in .NET Framework?
Not tested/verified
Did it work in any of the earlier releases of .NET Core or .NET 5+?
This is an issue reproduce on release/10.0-preview6
Issue description
When Application.SetColorMode set to SystemColorMode.System and change OS Color Mode the Button Click is no longer work;
Steps to reproduce
1- Enable Dark mode by adding below code lines in the Program.cs file under WinformsControlsTest project #pragma warning disable WFO5001 Application.SetColorMode(SystemColorMode.System); #pragma warning restore WFO5001
2- Open Settings -> Personalization ->Colors->Choose your Mode swithch OS Colors
https://github.com/user-attachments/assets/20f7ad06-18e3-40ab-86df-cd7e1b906436