472,353 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

paint question

i am using this code to try to paint a line on my form and it wont work i
get an object not set to a reference error

Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)

Dim formGraphics As System.Drawing.Graphics

formGraphics = Me.CreateGraphics()

formGraphics.DrawLine(myPen, 0, 0, 200, 200)



what is wrong

thanks for the help

Nov 20 '05 #1
0 1471

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Franck | last post by:
Hello, Sorry if that question has already been raised... I'm looking for the exact equivalent of Java paint(Graphics g) method in c# in order...
by: Tamir Khason | last post by:
How I can paint something onClick event? I need PaintEventArgs event in order to paint and raise Graphics, but onClick I have only EventArgs...
by: vooose | last post by:
Consider a UserControl TopCont that contains two other UserControls, CompA and CompB. Somewhere in the constructor of TopCont we have ...
by: vooose | last post by:
Consider a UserControl to which you do userControl.Paint += new PaintEventHandler(paint_method) If you don't like that way, and prefer to...
by: Mike Cooper | last post by:
I have been staring at the above error for over a week now! I have a an inherited data class looking like thus: Public Class...
by: WStoreyII | last post by:
i am using this code to try to paint a line on my form and it wont work i get an object not set to a reference error Dim myPen As New...
by: jcrouse | last post by:
I am rotating some text is some label controls. In the one place I use it it works fine. In the other place I use it I can't figure out the syntax....
by: hamil | last post by:
The following code will display a tif file on a form. When another form is moved over the tif image, the tif image is erased where the form was...
by: Sam | last post by:
Hai, I use a paintbox paint event to draw some images in a paintbox. I call the paint event by refreshing the paintbox using paintboxname.refresh()...
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
Hi, On a usercontrol I've put a set of radiobuttons within a groupbox. These radiobuttons have visual style enables, i.e. they turn orange when...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.