Krypton: "InvalidOperationException - object is currently in use elsewhere" on Windows 1809

Since the Windows 10 1809 release, we observed issues on some customers with the ribbon.

It seems that something is wrong with the Graphics object and its use in Krypton.

In our case, the issue occurs when we use a OpenFileDialog. It raise an exception on the Form app:

   à System.Drawing.Graphics.Restore(GraphicsState gstate)
   à System.Windows.Forms.Control.WmPaint(Message& m)
   à System.Windows.Forms.Control.WndProc(Message& m)
   à ComponentFactory.Krypton.Toolkit.VisualControlBase.WndProc(Message& m)
   à ComponentFactory.Krypton.Ribbon.KryptonRibbon.WndProc(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

For now, I am trying to reproduce the problem on my dev machine with debug builds.

If I am able to reproduce the problem locally I will update the issue.

Perhaps the root issue is the same as #46, and this windows update made the problem more frequent, I don’t know yet.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

FYI, this problem does not seems to occur anymore on v1903. You can consider this problem fixed in the fwk itself.

Thank you @Wagnerp. I will certainly use the 5.470 repo for issues (related to the ribbon & form integration bug) , as it seems to be the most active.