   [.net] Graphics.FillRectangle randomly fails with AccessViolation
  Hi, I have a mixed application which uses VB.NET, C++/CLI and C++. In the GUI, made with VB.NET, I have a custom user control which inherits from ToolStrip. Inside it, I have many other controls, some of which are custom controls which inherit from UserControl, and other are .NET controls. All this is done using .NET Windows Forms.    Since we refactored another control (not contained in the tool strip) to be a C++/CLI .NET control instead of an ActiveX, we started getting this error. We believe that it is due to the increase in the use of managed memory.    Everything works fine until I set Visible = False and Visible = True for some controls contained in my tool strip. When I do that, I get this Acces Violation in the tool strip's On Paint method. If I look at e.Graphics when the error occurs, the Visual Studio debugger says "The Object is currently in use elsewhere".    I have double checked that only one thread accesses the controls, but even so, this happens randomly...Edit: I forgot to say that I overrode OnPaint for my custom controls (and, according to the Documentation, I invoked MyBase.OnPaint)   