Can't get graphics to display

H

Harley

I am trying to build graphic charts in a vb.net module callable from another
form. I have translated this code from VB6 where it worked well. I can
make the code work to bring up and display the form and its command buttons.
I can track the code execution with debug. However, I cannot change the
background color of the form or see any of the drawline or drawtext
functions. Here are a few relevant lines of code:

Module SMPLOT3

Dim f As New Market_Charts.Form2()

Dim g As Graphics = f.CreateGraphics

f.BackColor = System.Drawing.Color.Black

g.DrawString(ymn1, myFont, New SolidBrush(Color.Yellow), currentx, currenty)

Any ideas?

Harley
 
C

Chris Dunaway

I am trying to build graphic charts in a vb.net module callable from another
form. I have translated this code from VB6 where it worked well. I can
make the code work to bring up and display the form and its command buttons.
I can track the code execution with debug. However, I cannot change the
background color of the form or see any of the drawline or drawtext
functions. Here are a few relevant lines of code:

Module SMPLOT3

Dim f As New Market_Charts.Form2()

Dim g As Graphics = f.CreateGraphics

f.BackColor = System.Drawing.Color.Black

g.DrawString(ymn1, myFont, New SolidBrush(Color.Yellow), currentx, currenty)

Where are you putting this code? The code you supplied will not
compile as is. Can you post a short but complete program that
illustrates your problem?

Try the following site for graphics related information for .Net:

www.bobpowell.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top