[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Printing lines

Posted on 2000-04-09
10
Medium Priority
?
173 Views
Last Modified: 2010-05-02
I use a picture box where I use the line statement.
Example: Picture.line (x, 2500)-(x,0)
The software draws a graph in this picture box. When trying to print this graph using: Myform.PrintForm everything prints but the graph.
(I use VB 6)
How can I get the graph printed??
0
Comment
Question by:soft4u
10 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2699308
try graphics mode = Persistent for the form

Hope this helps
0
 

Author Comment

by:soft4u
ID: 2699439
Never done this, How do I do this, where do I set this??

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2699453
Form.AutoRedraw = true
or Picture.AutoRedraw = true
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:soft4u
ID: 2699538
Adjusted points from 200 to 300
0
 

Author Comment

by:soft4u
ID: 2699539
Same problem remains! No printing of lines in picture box.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2699567
You are correct, i never tried to print lines in a picturebox, but it works fine when you paint on the form (but i think you don't want this).
You might then try to have a form instead of the picturebox (no border, nor resizable)
I found the article ID: Q77060 in the MSDN how to print the picturebox using API, but you certainly want to print the whole form...



0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 2699929
0
 

Expert Comment

by:mbah022100
ID: 2703003
How about using the printer.line method as you do on your picture box. I never use the printform method to avoid problems as you are encountering. A better way of printing is to do what you did on the picturebox exactly the same on the printer object. It takes some more effort, but once you get used to it you will see that the results are better.
0
 
LVL 1

Expert Comment

by:MinnEE
ID: 2706334
Look at the PaintPicture method to print a Picture box. It has the advantage of allowing you to locate and size the final printout on the paper.
But if you want to get the best looking printout, draw directly to the printer and get the benefit of the higher printer resolution.
0
 
LVL 28

Accepted Solution

by:
Ark earned 1200 total points
ID: 2707189
Private Sub Command1_Click()
Dim PrintingX as Long, PrintingY As Long
Dim PrintingWidth as Long, PrintingHeight as Long
' Set these values as you need
' You can first call .PrintForm method and then paint Picture on form at appropriate position
PrintingX = Printer.CurrentX
PrintingY = Printer.CurrentY
PrintingWidth = Picture1.Width
PrintingHeight = Picture1.Height
Printer.PaintPicture Myform.Picture1.Image, PrintingX, PrintingY, PrintingWidth, PrintingHeight
End Sub

Cheers
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month18 days, 1 hour left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question