Did you add a reference to the System.Windows.Forms assembly, which needs to be done before you can import any namespace it contains. The Windows Control Library project type has the reference and import by default, just like the Windows Application project. If you've created a Class Library project then you'll have to add them manually. There's no reason to believe that a Class Library is going to be used by a Windows Application so there is no specific reason to reference that assembly by default. A Cclass Library may just as easily be used by a Web Application or a Console Application.
Right click your project in the Solution Explorer and select Add Reference. On the .NET tab scroll down to System.Windows.Forms and double-click it. Done. From there you would still have to fully qualify every type from System.Windows.Forms namespace unless you add a 'using' statement to each file:
Code:
using System.Windows.Forms;
Last edited by jmcilhinney; Apr 6th, 2006 at 04:51 PM.