Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 22nd, 2004, 07:56 PM
Authorized User
 
Join Date: Jan 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default error with creating graphics object

Hi there,
         I am having problems with creating a new graphics object. When I declare the graghics object the word graphics is underlined in blue and the tooltip that is given says that type is expected. The definition is shown below:

dim bob as graphics

I am not sure what is wrong with this definition. Can anyone help?

Thanks,
Dinesh

 
Old January 22nd, 2004, 09:41 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

In order to use the Graphics class, you need to have a reference to the System.Drawing assembly. In your code, you need to reference the class with a fully qualified reference:

Dim bob As System.Drawing.Graphics

or you need to import the System.Drawing namespace and you can reference Graphics directly:

Imports System.Drawing
...
Dim bob As Graphics

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
converting .NET error object in VB error object webnet .NET Web Services 0 February 5th, 2007 06:02 AM
Error Creating Excel Object Antony Deepak ASP.NET 1.0 and 1.1 Professional 2 August 2nd, 2006 04:21 AM
Error Occurred creating Report Object: Object does sa_moizatyahoo Classic ASP Professional 0 February 1st, 2005 10:29 AM
Creating an Object MiltonAbreu Excel VBA 2 July 28th, 2004 11:57 AM
Error Creating an XMLDOM object sloynaz Classic ASP XML 7 May 11th, 2004 04:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.