User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 426,469 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,221 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 5159 | Replies: 11
Reply
Join Date: Jul 2007
Posts: 17
Reputation: 1qaz2wsx7 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
1qaz2wsx7 1qaz2wsx7 is offline Offline
Newbie Poster

Re: How to create a global function/class ?

  #11  
Aug 15th, 2007
Hi

I stll not working :/

I open a new Class Library project, write the code you wrote, i run
the project, and its not working.

Th error:

The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?) C:\Documents and Settings\adirim\My Documents\Visual Studio 2005\Projects\project\ClassLibrary1\Class1.cs 4 14 ClassLibrary1

What is the problem ?

Thanks.
Reply With Quote  
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,165
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Rep Power: 7
Solved Threads: 59
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: How to create a global function/class ?

  #12  
Aug 15th, 2007
You are missing a reference to the System.Windows.Forms.dll

In order to use the System.Windows.Forms namespace and classes in your code your project must reference the dll library in which those classes are compiled. When you create a windows application project this reference is included automatically by Visual Studio. When creating a class library you have to be explicit.

In the solution explorer right click the references folder below your class library project, select add reference. In the NET tab scroll down to System.Windows.Forms.dll and select it and click ok, now the using statement will be valid and the project should compile.
Last edited by hollystyles : Aug 15th, 2007 at 5:01 am.
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C# Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

All times are GMT -4. The time now is 3:52 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC