0

I am getting this nasty error every time I try to add a panel to any UserControl in the "Design" view. Here is the Stack Trace:

at System.Drawing.SafeNativeMethods.Gdip.GdipDrawRectangleI(HandleRef graphics, HandleRef pen, Int32 x, Int32 y, Int32 width, Int32 height)
   at System.Drawing.Graphics.DrawRectangle(Pen pen, Int32 x, Int32 y, Int32 width, Int32 height)
   at System.Drawing.Graphics.DrawRectangle(Pen pen, Rectangle rect)
   at System.Windows.Forms.Design.PanelDesigner.DrawBorder(Graphics graphics)
   at System.Windows.Forms.Design.PanelDesigner.OnPaintAdornments(PaintEventArgs pe)
   at System.Windows.Forms.Design.ControlDesigner.WndProc(Message& m)
   at System.Windows.Forms.Design.ScrollableControlDesigner.WndProc(Message& m)
   at System.Windows.Forms.Design.ControlDesigner.DesignerWindowTarget.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I have checked a similar question with the same exception but none of the answers fix my problem.

Also, I've tried to unchecked "Suppress JIT optimization on module load" and had no success.

Please, any advice?

Renato Pereira
  • 834
  • 2
  • 9
  • 22

0 Answers0