I use visual studio 2019 community edition and my program is a big winform application. When I try to open the winforms to edit them, I always get the error:
Error creating window handle.
bei System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
bei System.Windows.Forms.Control.CreateHandle()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl()
bei System.Windows.Forms.Control.ControlCollection.Add(Control value)
bei System.Windows.Forms.Form.ControlCollection.Add(Control value)
bei System.Windows.Forms.Design.ControlDesigner.DesignerControlCollection.Add(Control c)
I don't know how to fix it and I can't figure out what causes this error. In my forms there is one panel which gets injected in another panel.
Edit: I can build and start the application without errors but only the designer in visual studio is not working.
Edit2: I can open all windows which has no panel in it, if they have one I get the error.
Edit3: Sometimes the designer write that all of the controls and variables was not declared or was not assigned.