Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 12th, 2004, 12:52 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Drawing in C#

I have been trying to write a drawing program and the problem I have encountered is that when I enter the using statement, using System.Drawing; the following error occurs:
The type or namespace name 'Drawing' does not exist in the class or namespace 'System' (are you missing an assembly reference?)

COuld anyone tell me what the problem is?

Nicola


Reply With Quote
  #2 (permalink)  
Old April 12th, 2004, 01:42 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,413
Thanks: 0
Thanked 16 Times in 16 Posts
Default

To quote the error message "are you missing an assembly reference?" How are you compiling this? If you are in VS.net do you have a reference in the project to the System.Drawing assembly? If you are compiling with the command line, are you including a reference to that assembly in the reference options?

Peter
-------------------------
Work smarter, not harder
Reply With Quote
  #3 (permalink)  
Old April 13th, 2004, 12:46 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using VS .NET

I tried the example Creating a Graphics Path from Chp 16 in "Beginning Visual C#". This worked fine.

However if I try to use Using System.Drawing directives in a non-Windows application (Console Application) I get the error. In fact if I type the dot operator after System, I don't even get "Drawing" coming up on the pop-up list. I was hoping to print out from my program and do not require Windows form, do I have to use a Windows application for this? Just wondering?

Thanks

Nicola



Reply With Quote
  #4 (permalink)  
Old July 27th, 2004, 10:54 AM
Registered User
 
Join Date: Jul 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
This reply may be a little late going by the date you posted, hopefully you have figured out what was wrong, but this may still help some other people as I have seen this question posted on forums all over the net. Basicly as Planoe said, you have to add a reference to the assembly. To do this in your solution, on the top menu go to project->Add Reference

then scroll down and select the system.drawing.dll, you will now be able to declare using System.Drawing; in your console application.

I was also working from a book that failed to mention this to me, the book gave the impression that System.Drawing could just be declared and used, possibly it has been removed from a console apps standard References since our books were published.

Thanks Planoe, and this helps someone.

Gav
Reply With Quote
  #5 (permalink)  
Old August 25th, 2004, 10:01 AM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the replies.

I did manage to find out the solution to this problem elsewhere, but the answer may prove useful to someone else.

Thanks

Nicola


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing Shapes cbulutlar Javascript 2 March 6th, 2006 01:25 PM
drawing fergo Access VBA 0 June 6th, 2005 12:35 PM
drawing fergo BOOK: Access 2003 VBA Programmer's Reference 1 June 5th, 2005 09:32 AM
drawing with VBA cutovoi Excel VBA 1 February 19th, 2004 06:22 PM



All times are GMT -4. The time now is 05:29 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.