Click to See Complete Forum and Search --> : Unable to open designer window


raydona
January 26th, 2009, 01:24 PM
Hi,

I do not what has happened but every time I try to open the designer window (UI) for a form I get the following error message:

One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes

The designer could not be shown for this file because none of the classes within it can be designed

at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager) at

System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager) at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)

I do not know what the error means but it is not allowing me to view the UI so I am unable to work on it. I'd be grateful for all suggestions as to how I might fix the problem.

darwen
January 26th, 2009, 04:46 PM
The forms designer in C++/CLI is very flaky and I think the code it produces is horrible.

I design all my forms in C# for this very reason... I suggest you do the same.

But all things being equal - have you changed anything manually in the InitializeComponent method of the form ? If you have you'll need to undo these.

Darwen.

darwen
January 26th, 2009, 04:50 PM
Also, have you changed your form so it doesn't have a default constructor (i.e. one with no arguments) any more ? You'll need to give it a default constructor for the form designer to work (this is true of C# too).

I'm only guessing : there are lots and lots of reasons why you're getting this error... you may end up redesigning all your forms again.

And every time you make a code change (however small) to a form make sure it still works in the designer.

Darwen.

raydona
February 2nd, 2009, 01:47 PM
Darwen,
Many thanks for your reply. Firstly, can I connect a Windows Form created in C# to a static library created using C++, especially as the library accepts parameters such as char*? Secondly, I have not altered anything manually in the InitializeComponent method nor have I removed or altered the default constructor. The exact error that appears now is:

A circular control reference has been made. A control cannot be owned by or parented to itself.
at System.Windows.Forms.Control.CheckParentingCycle(Control bottom, Control toFind)
at System.Windows.Forms.Control.ControlCollection.Add(Control value)
at System.Windows.Forms.Form.ControlCollection.Add(Control value)
at System.Windows.Forms.Design.ControlDesigner.DesignerControlCollection.Add(Control c)

I would be very grateful if you could give me a solution as my designer window will not open and I am finding it very frustrating.