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
{{ message }}
Repository navigation
[VisualStylesMode: Net11] An exception pops up for checkbox after setting the FlatStyle = System & Appearance = ToggleSwitch with set VisualStylesMode as NET11 #14754
An exception pops up for checkbox after setting the FlatStyle = System & Appearance = ToggleSwitch with set VisualStylesMode as NET11
Steps to reproduce
Create a .NET winforms project
Set the VisualStylesMode as NET11 for the form1
Add CheckBox contorl on the form1.cs[Design]
Set the Appearance as ToggleSwitch & FlatStyle as System for the checbox1
Build & run the project
Click the checkbox1
**Call Stack: **
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.Forms.CheckBox.get_DownChangeRectangle() in C:\Klaus\winforms\src\System.Windows.Forms\System\Windows\Forms\Controls\Buttons\CheckBox.cs:line 420
at System.Windows.Forms.ButtonBase.OnMouseDown(MouseEventArgs mevent) in C:\Klaus\winforms\src\System.Windows.Forms\System\Windows\Forms\Controls\Buttons\ButtonBase.cs:line 965
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) in C:\Klaus\winforms\src\System.Windows.Forms\System\Windows\Forms\Control.cs:line 11756
at System.Windows.Forms.Control.WndProc(Message& m) in C:\Klaus\winforms\src\System.Windows.Forms\System\Windows\Forms\Control.cs:line 12700
at System.Windows.Forms.ButtonBase.WndProc(Message& m) in C:\Klaus\winforms\src\System.Windows.Forms\System\Windows\Forms\Controls\Buttons\ButtonBase.cs:line 1516
at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, UInt32 msg, WPARAM wparam, LPARAM lparam) in C:\Klaus\winforms\src\System.Windows.Forms\System\Windows\Forms\NativeWindow.cs:line 351
************** Loaded Assemblies **************
Activity
Fix ToggleSwitch System mouse geometry
Fix ToggleSwitch System mouse geometry
Fix ToggleSwitch System mouse geometry
Zheng-Li01 commentedon Jul 20, 2026
Tested the fix in .NET 11/Integration-3: #14768, it was fixed:
Fix ToggleSwitch System mouse geometry
Fix ToggleSwitch System mouse geometry
.NET 11: integrate application, rendering, and visual styles APIs (#1…
.NET 11: integrate application, rendering, and visual styles APIs (#1…