V
Vlado
VS2005 C#
I have something like this:
public class MyControl : Panel
{
private SomeCollection myCollectionProp = new SomeCollection();
public SomeCollection MyCollectionProp
{
get
{
return this.myCollectionProp;
}
}
}
I put MyControl on a form (from toolbox). When I want to fill a
MyCollectionProp in a property grid I get message
"Object reference not set to an instance of an object." I can not figure
why.
Then, I tried to debug MyControl's design-time (Debug -> Attach to
Process... -> devenv) but when I try to open a collection editor from a
property grid, no exception is thrown and I can fill MyCollectionProp
normally. If I stop debugging and save changes and then start debug of
application everything works fine.
Can anyone explain what am I doing wrong and what is the difference between
normal design-time and design-time debug?
If that is some kind of bug maybe there is a workaround or should I create
my forms in design-time debug?
I hope you understand the problem. Any clue would be appreciated.
Vlado
I have something like this:
public class MyControl : Panel
{
private SomeCollection myCollectionProp = new SomeCollection();
public SomeCollection MyCollectionProp
{
get
{
return this.myCollectionProp;
}
}
}
I put MyControl on a form (from toolbox). When I want to fill a
MyCollectionProp in a property grid I get message
"Object reference not set to an instance of an object." I can not figure
why.
Then, I tried to debug MyControl's design-time (Debug -> Attach to
Process... -> devenv) but when I try to open a collection editor from a
property grid, no exception is thrown and I can fill MyCollectionProp
normally. If I stop debugging and save changes and then start debug of
application everything works fine.
Can anyone explain what am I doing wrong and what is the difference between
normal design-time and design-time debug?
If that is some kind of bug maybe there is a workaround or should I create
my forms in design-time debug?
I hope you understand the problem. Any clue would be appreciated.
Vlado