Using System.Windows.Forms in dlls

M

Mr. X.

Hello.
I want to use System.Windows.Forms in dlls (C#).
In VB - there was no problem to add :
includes System.Windows.Forms.

How I overcome this problem in C# ?

Thanks :)
 
J

Jeff Johnson

I want to use System.Windows.Forms in dlls (C#).
In VB - there was no problem to add :
includes System.Windows.Forms.

How I overcome this problem in C# ?

Besides the include statement you must set a reference to the assembly.
 
A

Arne Vajhøj

I want to use System.Windows.Forms in dlls (C#).
In VB - there was no problem to add :
includes System.Windows.Forms.

How I overcome this problem in C# ?

The references that the IDE automatically adds depends
on the project type.

For a Windows app the IDE adds System.Windows.Forms.dll,
but for a class librray you have to add it manually.

Arne
 
A

Arne Vajhøj

The references that the IDE automatically adds depends
on the project type.

For a Windows app the IDE adds System.Windows.Forms.dll,
but for a class librray you have to add it manually.

Note that a DLL that uses Win Forms is not fully
reusable, because it does not work in some contexts.

Unless you need some plugin capability, then I would
keep the GUI specific stuff in the main EXE.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

JIT Debugging 1
Using statements inside namespace 5
suddenly having to add System.Windows.Forms. 3
? 2
newbie ques openfiledialog 9
System.Windows.Forms namespace 7
C# can't create Window Forms? 3
NotifyIcon 2

Top