We are having an issue with our Windows forms application where it is terminating due to an unhandled exception of type AccessViolationException that the stack trace is indi
According to MS, there is a known issue with the DataGrid control in certain situations, and the way to avoid this issue is to disable Tooltips for your DataGrid controls.
We will be implementing the change and rolling it out to a pilot group in the next couple of days, I'll post back with success/failure in about a week (unless of course failure happens before then).
The property to set according to MS is DataGridView.ShowCellToolTips = false;
This fixed the issue for our application.
To reproduce the issue, we needed to do the following:
It seems that setting DataGridView.ShowCellToolTips = false on Form.Deactivate prevents the crash. It can be reset to true on Form.Activate.
The tooltip is still shown above the newly focused windows however - but I guess that's better then crashing.
Or even better:
The problem only occurs when visual styles are not enabled.
Adding Application.EnableVisualStyles() in main() before any forms are instantiated solves the problem.
more details https://github.com/Microsoft/dotnet/issues/402
6 years later, solution is unfortunately still "use comctl v6"