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

  • Thread starter Thread starter UJ
  • Start date Start date
U

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.
 
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
 
UJ said:
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.
 

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

Back
Top