First.
Happy New Years to all.
I am using VB6.0 SP5.
I need to print a rectangle on my print out.
How can I do this?

Signature
Thanks
Robert
robert11@mountaincable.net
Mike Williams - 31 Dec 2006 15:33 GMT
> I am using VB6.0 SP5.
> I need to print a rectangle on my print out.
> How can I do this?
Have a look at the Printer object's Line method.
Mike
PC - 31 Dec 2006 15:43 GMT
example:
PrintOutDevice.Line (10, 10)-(2000, 1000), vbRed, B 'F
where PrintOutDevice can be a form,a picturebox,a printer
> First.
> Happy New Years to all.
[quoted text clipped - 10 lines]
> Robert
> robert11@mountaincable.net
Rick Rothstein (MVP - VB) - 31 Dec 2006 15:47 GMT
> I am using VB6.0 SP5.
>
> I need to print a rectangle on my print out.
>
> How can I do this?
You can use the Line method. Here is a link to the online help files for
it...
http://msdn.microsoft.com/library/en-us/vb98/html/vamthLine.asp
Note in particular the last (optional) argument. Specifying the B makes the
Line method draw a rectangular outline; specifying BF will draw a fill-in
rectangle. See the Example link on that page to see some code that does
this. Although the example shows it being used to draw on the active form
(the default object for the Line method), you can specify a PictureBox,
UserControl or Printer by prefixing the Line method with the appropriate
object). For example, for a printer it could look something like this...
Printer.Line (X1coord, Y1coord)-(X2coord, Y2coord), , BF
Rick