Question PrintPage: DrawString from Function. How to create Graphics from Function?

George_259

New member
Joined
Oct 28, 2012
Messages
1
Programming Experience
3-5
Hi!

I'm using a PrintDocument to create a report and I need to create a line from a function. I'm doing this:


Private Sub Crate_String(ByVal Str As String)
Dim gr As Graphics
gr.DrawString(str, Font, Brushes.Black, x, y)
end sub

But give error with the graphics object: It says to use the word "new" to instance de object.
How to declare the Graphics?

Thanks.
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,609
Location
Norway
Programming Experience
10+
Pass the Graphics object from PrintPage event.
 
Top Bottom