CollectionEditor in VB 2005 Express

Is the CollectionEditor available in VB2005 Express? I get a "is not defined" error even though I have included all the imports that I have seen in various examples. My imports are:
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Globalization
Imports System.ComponentModel
Imports System.Drawing.Design ' for UITypeEditor
Imports System.Windows.Forms.Design
Imports System.ComponentModel.Design
When I look at the object browser I see that System.ComponentModel.Design does have the CollectionEditor, but it is still not getting defined for some reason.
Any help would be appreciated.
[683 byte] By [Kiz] at [2007-12-17]
# 1
Yes, the collection editor is available in VB2005 Express. Please note that there is a difference between importing a namespace (putting an Imports <whatever namespace> in your file) and adding a reference to an assembly - the Import simply lets you refer to types without having to specify the fully namespace qualified type name *if you have a reference to the assembly where the type is defined*. Adding a reference actually makes the type available to the referencing assembly.

Now, you say that you can see the type in the object browser. This makes me think that you have the appropriate reference in your project (in this case to the System.Design assembly). Could you please share some of the code that is giving you the error?

Best regards,
Johan Stenberg

MSFTJohanStenberg at 2007-10-6 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 2
Thanks for your response. I figured it out based on your e-mail. There was not a reference to System.Design in my project. Strange that the object browser saw it. I added a reference and all worked OK.
Kiz at 2007-10-6 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 3
I am very sorry, Mr. Stenberg, but your answer is leading to “blind point”. However it is possible to get ‘CollectionEditor’ in VB 2k5 Express, but usable is only ‘CollectionEditor.CollectionForm’ class. Unfortunately this last one is a base class defined as “Protected”. Consequently user can do nothing with it.

Regards

Piotr Sobiegraj

psoDOB at 2007-10-6 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 4

To extend the the base collection editor, you would create a new class that inherits from the CollectionEditor base class, and protected members are visible from within the derived class.

Check out http://www.dotnet247.com/247reference/msgs/22/113060.aspx. The post & question are in C#, but the same principles apply for VB.

There are a couple of other tricks that you can do with the collection editor listed under the Design Time Type Editors listed here:

http://msdn.microsoft.com/smartclient/community/wffaq/ctrl.aspx

Best regards,
Johan Stenberg

MSFTJohanStenberg at 2007-10-6 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...