From: Terry Ford <tmford at shaw dot ca>
Reply-To: Getting Started <gettingstarted at lists dot realsoftware dot com>
To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: (Print) Preview button
Date: Thu, 21 Apr 2005 22:06:16 -0700
On Apr 21, 2005, at 9:43 PM, Lennox Jacob wrote:
I made a new window and I called it Preview, I fill that whole window with
a canvas and called that canvas1. In the Paint event I added this
Sub Paint(g As Graphics)
Dim gp as graphics
gp.textfont = "Courier"
gp.textsize = 9
gp.drawstring ("Your name is "),36, 156, 540
gp.drawstring ("Your address is "), 36, 168, 540
End Sub
And I am stuck for now.
Well you have two choices with the above code. You can add under the Dim gp
as graphics:
gp=g // which makes no sense as the paint event already has the g As
Graphics property built in.
or change the rest of your code to:
g.textfont = "Courier"
g.textsize = 9
g.drawstring ("Your name is "),36, 156, 540
g.drawstring ("Your address is "), 36, 168, 540
Both will work for your example but I don't think that's what you really
wish to do for a Preview.
It would be much better to assign a picture property to the window and draw
into that using the NewPicture method. In the Canvas Paint event you would
simply draw the picture.
If you wish to preview an editfield that you will be using to print, (you
really didn't make your objective very clear), you can use the
StyledTextPrinter class in a preview canvas as well.
Need more data to go further.
Terry
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>