Windows Develop Bookmark and Share   
 index > Windows Forms Designer > UserControl with an ArrayList property raises an editor error.
 

UserControl with an ArrayList property raises an editor error.

Hello,

Visual C++ .NET 2005 raises an error in the form editor using a UserControl that has an ArrayList property on it. This doesn't happen in C#.

The error message is:

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.

Either VCProject or VCCodeModel is not ready yet. Please close designer and try again.

Hide

at Microsoft.VisualC.CppCodeParser.Parse(TextReader codeStream)
at System.CodeDom.Compiler.CodeDomProvider.Parse(TextReader codeStream)
at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomDocDataAdapter.get_CompileUnit()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)

The code of the UserControl is:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Drawing;

using System.Data;

using System.Text;

using System.Windows.Forms;

namespace ListFailure

{

public partial class ListFailure : UserControl

{

public ListFailure()

{

InitializeComponent();

}

protected override void OnPaint(PaintEventArgs e)

{

e.Graphics.FillRectangle(Brushes.Red, e.ClipRectangle);

base.OnPaint(e);

}

private StringList stringList;

public StringList StringList

{

get

{

if (stringList == null)

{

stringList = new StringList(100);

}

return stringList;

}

set { stringList = value; }

}

}

public class StringList : List<string>

{

public StringList() { }

public StringList(int capacity) : base(capacity) { }

}

}


This UserControl is just a simple example to reproduce the problem. The real problem is found using a custom control, which uses ArrayLists, in a managed C++ form.

Is there anything that can be done to solve this problem?

Thanks in advance.
NarcĂ­s Calvet  Friday, November 24, 2006 11:48 AM
I've the same problem exactly in VS2008. Unfortunately, I don't know how to correct it. There is a similar problem "http://social.msdn.microsoft.com/Forums/en-US/winformsdesigner/thread/717eb8e6-ff84-4e41-b66c-1fe1e4ac1802/" ,but their decision isn't reliable in my instance. I think it's a bag :(. If I correct this problem, I'll write decision.
venitatum  Sunday, September 20, 2009 10:23 AM

You can use google to search for other answers

Custom Search

More Threads

• About Microsoft Express blend
• VerticalText in DataGrid
• add record question
• Dynamic loading of UI controls
• How does the Designer link the Name property to the control variable name?
• Implementing auto-hide feature
• Alternating cursor
• DragDrop in 2.0 Custom Designer problems
• Raising events in inheritance forms
• Retrieving a combobox entry from a supplied index