Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General / December 2006



Tip: Looking for answers? Try searching our database.

Printing a rectangle

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert - 31 Dec 2006 15:12 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.