Solved

Printing lines

Posted on 2000-04-09
10
169 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

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 300 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

726 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