S
scottiedog
Hi,
When I add a derived class from CollectionBase to a user control, the
form that uses the user control failed out on designer window with
error, (To prevent possible data loss before loading the designer, the
following errors must be resolved). I can continue on with ignore
this error, but the collection dialog doesn't save my selection. And
it is missing (Collection) word in the property section of the user
control.
Here is the derived CollectionBase class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace Test
{
[Serializable()]
public class TextCollection : CollectionBase
{
private string[] _items;
public TextCollection()
{
}
public TextCollection(string[] items)
{
_items = items;
}
}
}
The user control has this.
[Editor("System.Windows.Forms.Design.StringCollectionEditor,System.Design",
"System.Drawing.Design.UITypeEditor, System.Drawing")]
//[Description("Button Text Collection")]
public TextCollection TextItems
{
get { return _items; }
set
{
_items = value;
_max = _items.Count;
//more to do;
}
}
If I comment out the above TextItems property, the designer error no
longer shows up.
Can you spot what I'm doing wrong? Thanks.
When I add a derived class from CollectionBase to a user control, the
form that uses the user control failed out on designer window with
error, (To prevent possible data loss before loading the designer, the
following errors must be resolved). I can continue on with ignore
this error, but the collection dialog doesn't save my selection. And
it is missing (Collection) word in the property section of the user
control.
Here is the derived CollectionBase class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace Test
{
[Serializable()]
public class TextCollection : CollectionBase
{
private string[] _items;
public TextCollection()
{
}
public TextCollection(string[] items)
{
_items = items;
}
}
}
The user control has this.
[Editor("System.Windows.Forms.Design.StringCollectionEditor,System.Design",
"System.Drawing.Design.UITypeEditor, System.Drawing")]
//[Description("Button Text Collection")]
public TextCollection TextItems
{
get { return _items; }
set
{
_items = value;
_max = _items.Count;
//more to do;
}
}
If I comment out the above TextItems property, the designer error no
longer shows up.
Can you spot what I'm doing wrong? Thanks.