G
Guest
I have a user control on a Windows Form that, in its Load event handler,
calls a method from a class library to initialize an array of objects that
are then used to populate a ComboBox.
When I run the app, the method runs just fine. The class library returns
the array of objects and the ComboBox is loaded.
The problem I am having is when I try to open the form that contains the
user control in the designer. Instead of the form, I get the ugly pink and
white designer error page that you've probably seen before. The error it
shows says:
Method not found: 'MyLib.MyObj[] MyLib.ClassInMyLib.GetList()'.
I have tried making the whole thing static - there's no reason at all to
instantiate the class to get this list - but that didn't work. Next, I tried
non-static where I had to create an instance of the class in my user control.
I get the same error. I have tried calling the method directly from the
assignment to the ComboBox and I have tried filling a local array from the
method and assigning that to the ComboBox.
No matter what I have tried, the error from the designer is exactly the same
- not a single character in the message is different. It reads right through
all my attempts at obfuscation and rejects the underlying method.
Oh, and I tried returning the array as a property named ObjectList. That
changed the error message only in that it now said:
Method not found: 'MyLib.MyObj[] MyLib.ClassInMyLib.get_ObjectList'.
The designer sees right past the property and rejects the underlying getter.
Like I said, I can compile this program and run it and it all works as
expected. I just can't work with it in the designer any more.
Any help at all would be greatly appreciated.
Dale
calls a method from a class library to initialize an array of objects that
are then used to populate a ComboBox.
When I run the app, the method runs just fine. The class library returns
the array of objects and the ComboBox is loaded.
The problem I am having is when I try to open the form that contains the
user control in the designer. Instead of the form, I get the ugly pink and
white designer error page that you've probably seen before. The error it
shows says:
Method not found: 'MyLib.MyObj[] MyLib.ClassInMyLib.GetList()'.
I have tried making the whole thing static - there's no reason at all to
instantiate the class to get this list - but that didn't work. Next, I tried
non-static where I had to create an instance of the class in my user control.
I get the same error. I have tried calling the method directly from the
assignment to the ComboBox and I have tried filling a local array from the
method and assigning that to the ComboBox.
No matter what I have tried, the error from the designer is exactly the same
- not a single character in the message is different. It reads right through
all my attempts at obfuscation and rejects the underlying method.
Oh, and I tried returning the array as a property named ObjectList. That
changed the error message only in that it now said:
Method not found: 'MyLib.MyObj[] MyLib.ClassInMyLib.get_ObjectList'.
The designer sees right past the property and rejects the underlying getter.
Like I said, I can compile this program and run it and it all works as
expected. I just can't work with it in the designer any more.
Any help at all would be greatly appreciated.
Dale