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.