Home All Groups Group Topic Archive Search About

Moving a windows form from a windows app to a class library.

Author
7 Apr 2005 6:33 PM
UJ
I have a class that makes reference to a windows form. I am trying to make
that class a class library and when I include the window file, it says that
system.windows.form.form is not defined.

How can I make a library the includes a window?

TIA.

Jeffrey.

Author
7 Apr 2005 6:47 PM
Joseph MCAD
April 7, 2005

   You must add a reference to System.Windows.Forms in your solution
explorer. This will allow you to reference forms objects in code. Hope this
helps! :-)

                                                           Joseph MCAD



Show quoteHide quote
"UJ" <U*@nowhere.com> wrote in message
news:%23HbWNB6OFHA.3880@tk2msftngp13.phx.gbl...
>I have a class that makes reference to a windows form. I am trying to make
>that class a class library and when I include the window file, it says that
>system.windows.form.form is not defined.
>
> How can I make a library the includes a window?
>
> TIA.
>
> Jeffrey.
>
>
Author
7 Apr 2005 6:56 PM
Herfried K. Wagner [MVP]
"UJ" <U*@nowhere.com> schrieb:
>I have a class that makes reference to a windows form. I am trying to make
>that class a class library and when I include the window file, it says that
>system.windows.form.form is not defined.


Make sure your class library project contains a reference to
"System.Windows.Forms.dll".  You can add a reference to this DLL by
selecting the project's "References" folder in the solution explorer,
choosing "Add reference..." from its context menu and picking
"System.Windows.Forms.dll" from the ".NET" tab.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>