Posted 6 September 2024, 9:21 am EST
Hi C1,
C1SplitButton crashes if a UIAutomation provider is enabled (e.g. caused by windows screen narrator, might also happen in RDP/Citrix sessions):
Exception-Type: System.InvalidCastException
Message: Unable to cast object of type 'C1.Win.Input.SplitButtonItem' to type 'C1.Win.Input.C1SplitButton'.
StackTrace:
at i.a()
at i..ctor(bd a, dm b)
at bd.bc()
at fv.get_b()
at cm..ctor(dm a, C1SplitButton b)
at dm.ck()
at fw.get_b()
at fw.WndProc(Message& a)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)
Attached sample reproduces it:
step 1: start windows screen narrator
step 2: start the sample, drop down the split button and hover over the items. I have a global “unhandled exception” handler which shows a messagebox.
Some time ago, a similar problem happened with C1FlexGrid: https://developer.mescius.com/forums/winforms-edition/c1flexgrid-crash-raiseautomationevent-value-cannot-be-null
But I cannot apply the workaround to override WndProc and ignore event “61”. My sample already contains a C1SplitButton subclass, but the issue still happens. Do you have any idea?
Best regards
Wolfgang