Windows Forms as a resource in a Class Library project

avineshp used Ask the Experts™

I'm trying to add a custom dialog to a DLL Class Library project. If I have a look at my example DLL file it has the "Dialog" folder in it. I can't achieve this. Can someone please help? I am using Visual Studio 2010 (Visual  Basic Language).

Thanks in advance
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015

By default, the Windows.Forms namespace is not activated in a Class Library project, so you cannot create forms (dialogs).

In order to be able to do so, you need to add a reference to namespace.

Right click on your project in the Solution Explorer.
Select Add Reference...
Select the .NET tab.
Select System.Windows.Forms.
Click OK.
The forms and a few of their features (such as MessageBox) will now be available in your Class Library.


Hi JamesBurger,

Thanks for your comment.

I do have that reference added in.

I'm trying to create a COM Object. This COM Object will have scripts in it and a property dialog box which an external application will find and bring it up.

See attached of a COM Object that I am trying to create. It needs to have a property dialog box which an external application will find and use it.

Top Expert 2015

You cannot create a COM object in Visual Basic .NET.

In order to create a COM object, you need to either use the classic Visual Basic 6, or C++ in an unmanaged code configuration.

However, I think I understand your question better now. You would like to have folders in your project?

If so, right click on the project, select Add and then New Folder.


No i'm not asking about a new folder in a project. The image i have shown above is that of a COM DLL. I want to achieve the same structure
Top Expert 2015
Then you will have to revert to an older development environments.

.NET is completely different from COM.

The manifests do not have the same format.

.NET does not has a TypeLib. The equivalent is called a manifest (not the same thing as a manifest file) and is included automatically in the application or dll by the compiler.

I do not think that you can embed a script inside a compiled exe or dll, only in an asp page.

Versioning is not done the same way.

Properties are not defined as a separate entity.

Memory is not managed the same way.

And I repeat something I have said earlier. You cannot create a COM object in VB.NET. You need to revert to Classic VB if you want to do it in VB, or program in C++ if you want to do it in Visual Studio .NET.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial